File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -527,6 +527,22 @@ def method2(self):
527527 assert C ().has_default () == 3
528528
529529
530+ def test_override_default ():
531+
532+ class IFace (Interface ): # pragma: nocover
533+
534+ @default
535+ def default (self ):
536+ return 'ayy'
537+
538+ class C (implements (IFace )): # pragma: nocover
539+
540+ def default (self ):
541+ return 'lmao'
542+
543+ assert C ().default () == 'lmao'
544+
545+
530546def test_conflicting_defaults ():
531547
532548 class IFace1 (Interface ): # pragma: nocover
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ class TypedSignature(object):
2121 """
2222 def __init__ (self , obj ):
2323 self ._type = type (obj )
24+ if self ._type is default :
25+ self ._type = type (obj .implementation )
26+
2427 self ._signature = signature (extract_func (obj ))
2528
2629 @property
You can’t perform that action at this time.
0 commit comments