| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| from functools import cached_property | ||
|
|
||
| # docstring in parent, inherited in child | ||
| class ParentInheritDoc: | ||
| @cached_property | ||
| def foo(self): | ||
| """docstring for foo defined in parent""" | ||
|
|
||
| class ChildInheritDoc(ParentInheritDoc): | ||
| pass | ||
|
|
||
| class ChildInheritDefineDoc(ParentInheritDoc): | ||
| @cached_property | ||
| def foo(self): | ||
| pass | ||
|
|
||
| # Redefine foo as something other than cached_property | ||
| class ChildPropertyFoo(ParentInheritDoc): | ||
| @property | ||
| def foo(self): | ||
| """docstring for the property foo""" | ||
|
|
||
| class ChildMethodFoo(ParentInheritDoc): | ||
| def foo(self): | ||
| """docstring for the method foo""" | ||
|
|
||
| # docstring in child but not parent | ||
| class ParentNoDoc: | ||
| @cached_property | ||
| def foo(self): | ||
| pass | ||
|
|
||
| class ChildNoDoc(ParentNoDoc): | ||
| pass | ||
|
|
||
| class ChildDefineDoc(ParentNoDoc): | ||
| @cached_property | ||
| def foo(self): | ||
| """docstring for foo defined in child""" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| :func:`inspect.getdoc` now correctly returns an inherited docstring on | ||
| :class:`~functools.cached_property` objects if none is given in a subclass. |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.