Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lazy
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MycroftAI packaging team
lazy
Commits
09db609a
Commit
09db609a
authored
2 years ago
by
Stefan H. Holek
Browse files
Options
Downloads
Patches
Plain Diff
Add subclassing example.
parent
39128a62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lazy/examples/example.py
+11
-0
11 additions, 0 deletions
lazy/examples/example.py
with
11 additions
and
0 deletions
lazy/examples/example.py
+
11
−
0
View file @
09db609a
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment