-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
bpo-34706: Preserve subclassing in Signature.from_callable #9344
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
Please add a NEWS entry and I'll merge this. Thanks! |
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.
Is this a bug fix or adding a new feature? In the former case it should be backported to older Python versions. In the latter case it needs a versionchanged
directive in the documentation.
Lib/test/test_inspect.py
Outdated
class MySignature(inspect.Signature): pass | ||
class foo: pass | ||
foo_sig = MySignature.from_callable(foo) | ||
self.assertTrue(isinstance(foo_sig, MySignature)) |
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.
Use assertIsinstance()
.
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.
This is the style used in this file. AssertIsinstance is not used at all. Shall I change the rest of the file or only this line? Such cleanup may be better as a separate PR.
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.
we use the more modern assertion methods when writing new code. don't worry about the rest of the file.
I did see that notice, but couldn't figure out what to write, or whether this change is notable. What should the NEWS entry say? "Preserve subclassing in Signature.from_callable" ? |
Modify the wheel event handler so it can also be used for module, path, and stack browsers. Patch by George Zhang.
It should avoid dynamic lookup including `isinstance`. This is a regression caused by pythonGH-5351.
* Remove implementation for old plistlib API deprecated in 3.4
Add flag -k to pathscript.py script: preserve shebang flags.
If Python is installed, skip test_tools.test_pathfix test because Tools/scripts/pathfix.py script is not installed.
Remove PyGen_NeedsFinalizing(): it was not documented, tested or used anywhere within CPython after the implementation of PEP 442.
Restart lines now always start with '=' and never end with ' ' and fill the width of the window unless that would require ending with ' ', which could be wrapped by itself and possible confusing the user.
It looks like they are unused since 87cf220.
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
my push failed to do the right thing, i'll re-create this PR. |
…H-16108) https://bugs.python.org/issue34706 Specifically in the case of a class that does not override its constructor signature inherited from object. These are Buck Evan @bukzor's changes cherrypicked from GH-9344.
…ythonGH-16108) https://bugs.python.org/issue34706 Specifically in the case of a class that does not override its constructor signature inherited from object. These are Buck Evan @bukzor's changes cherrypicked from pythonGH-9344. (cherry picked from commit 5b9ff7a) Co-authored-by: Gregory P. Smith <greg@krypto.org>
…H-16108) (GH-16113) https://bugs.python.org/issue34706 Specifically in the case of a class that does not override its constructor signature inherited from object. These are Buck Evan @bukzor's changes cherrypicked from GH-9344. (cherry picked from commit 5b9ff7a) Co-authored-by: Gregory P. Smith <greg@krypto.org>
…H-16108) (GH-16114) https://bugs.python.org/issue34706 Specifically in the case of a class that does not override its constructor signature inherited from object. These are Buck Evan @bukzor's changes cherrypicked from GH-9344. (cherry picked from commit 5b9ff7a) Co-authored-by: Gregory P. Smith <greg@krypto.org>
https://bugs.python.org/issue34706
Specifically in the case of a class that does not override its constructor signature inherited from object.
https://bugs.python.org/issue34706