-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-131116: Fix inspect._finddoc to work with cached_property objects. #131165
New issue
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
Open
lincolnj1
wants to merge
15
commits into
python:main
Choose a base branch
from
lincolnj1:getdoc-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
19d5c42
attempted fix of issue #131116. Test case failing on non changed parts
lincolnj1 02ec2c1
Moved new test fodder to seperate file to fix errors
lincolnj1 8786c3c
Cleaned workspace and actually added the changed files this time
lincolnj1 9fe818c
Merge branch 'python:main' into getdoc-fix
lincolnj1 5772f7b
Seperated new tests into new test case
lincolnj1 f68119e
Merge branch 'getdoc-fix' of github.com:lincolnj1/cpython into getdoc…
lincolnj1 2406055
📜🤖 Added by blurb_it.
blurb-it[bot] 5f0d6d4
Merge branch 'python:main' into getdoc-fix
lincolnj1 d61ab34
Added more tests and versionchanged to Doc
lincolnj1 4b74d4e
Update Doc/library/inspect.rst
lincolnj1 cfe3e99
Update Lib/test/test_inspect/inspect_fodder3.py
lincolnj1 fa92ad3
Update Lib/test/test_inspect/inspect_fodder3.py
lincolnj1 d83205c
Update Lib/test/test_inspect/inspect_fodder3.py
lincolnj1 c4764ff
Update Lib/test/test_inspect/inspect_fodder3.py
lincolnj1 1b0471f
Fixed inspect_fodder3 comments and added new test cases
lincolnj1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| from functools import cached_property | ||||||
|
|
||||||
picnixz marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| # Docstring in parent, inherited in child | ||||||
picnixz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| class ParentInheritDoc: | ||||||
| @cached_property | ||||||
| def foo(self): | ||||||
| "docstring for foo defined in parent" | ||||||
lincolnj1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| class ChildInheritDoc(ParentInheritDoc): | ||||||
| @cached_property | ||||||
| def foo(self): | ||||||
| pass | ||||||
|
|
||||||
| # Redine foo as something other than cached_property | ||||||
|
||||||
| # Redine foo as something other than cached_property | |
| # redefine foo as something other than cached_property |
lincolnj1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
lincolnj1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
| pass |
lincolnj1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
lincolnj1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
picnixz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
picnixz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
lincolnj1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
lincolnj1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Library/2025-03-12-18-57-10.gh-issue-131116.uTpwXZ.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||||
| :func:`inspect.getdoc` now correctly returns an inherited docstring on :class:`~functools.cached_property` objects if none is given in a subclass. | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.