-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-119605: Respect follow_wrapped
for __init__
and __new__
when getting class signature with inspect.signature
#132055
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
aa8865e
Preserve class signature after wrapping with `@warnings.deprecated`
XuehaiPan d093b57
📜🤖 Added by blurb_it.
blurb-it[bot] 9664211
Add test to class signature
XuehaiPan a1dd52e
Fix tests
XuehaiPan 668adb3
Merge branch 'main' into deprecated-signature
XuehaiPan 68eebad
Handle potential assignment failure
XuehaiPan 57c61c3
Update tests
XuehaiPan 6e28f0b
Use `__signature__`
XuehaiPan 88666b0
Merge branch 'main' into deprecated-signature
XuehaiPan 43b0977
Remove duplicate in tests
XuehaiPan 4dd8b70
Unwrap decorated __new__ and __init__ in inspect
XuehaiPan 6b7bd71
Unwrap decorated __new__ and __init__ in inspect
XuehaiPan bb2c39b
Merge branch 'main' into deprecated-signature
XuehaiPan ca8aa96
Fix tests
XuehaiPan 636c687
Fix tests
XuehaiPan 97a17b2
Merge branch 'main' into deprecated-signature
XuehaiPan 930881f
Merge branch 'main' into deprecated-signature
XuehaiPan 11f8218
Merge branch 'main' into deprecated-signature
XuehaiPan 198f8ee
Revert unneeded changes
XuehaiPan 2c50424
Respect `follow_wrapper_chains`
XuehaiPan c62184a
Update news entry
XuehaiPan 759d403
Add test for inspect
XuehaiPan c27ee65
Update news entry
XuehaiPan c148a7d
Update news entry
XuehaiPan 72c1d5a
Update news entry
XuehaiPan 2b7445b
Update news entry
XuehaiPan e8a3a1e
Merge branch 'main' into deprecated-signature
XuehaiPan 2517a21
Fix tests
XuehaiPan 44f103f
Simplify branches
XuehaiPan 6693ead
Handle all method descriptor types
XuehaiPan 82ab31e
Merge branch 'main' into deprecated-signature
XuehaiPan 9386d40
Merge branch 'main' into deprecated-signature
XuehaiPan 8627478
Merge branch 'main' into deprecated-signature
XuehaiPan 0736846
Update tests
XuehaiPan 2a76c9e
Merge branch 'main' into deprecated-signature
XuehaiPan 144e629
Merge branch 'main' into deprecated-signature
XuehaiPan 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
4 changes: 4 additions & 0 deletions
4
Misc/NEWS.d/next/Library/2025-04-03-17-19-42.gh-issue-119605.c7QXAA.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,4 @@ | ||
Respect ``follow_wrapped`` for :meth:`!__init__` and :meth:`!__new__` methods | ||
when getting the class signature for a class with :func:`inspect.signature`. | ||
Preserve class signature after wrapping with :func:`warnings.deprecated`. | ||
Patch by Xuehai Pan. |
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.