Skip to content
Snippets Groups Projects
Commit 09db609a authored by Stefan H. Holek's avatar Stefan H. Holek
Browse files

Add subclassing example.

parent 39128a62
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,13 @@ class C(object):
return date(2010, 10, 10)
class D(C):
@lazy
def foo(self) -> str:
return super().foo
def f() -> None:
c = C()
'hello ' + c.foo
......@@ -39,3 +46,7 @@ def f() -> None:
type(c.foo) == str
type(c.baz) == int
d = D()
'hello ' + d.foo
'hello ' + super(D, d).foo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment