Skip to content
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

Closed
wants to merge 2,119 commits into from

Conversation

bukzor
Copy link

@bukzor bukzor commented Sep 16, 2018

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

@the-knights-who-say-ni
Copy link

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!

@1st1
Copy link
Member

1st1 commented Sep 16, 2018

Please add a NEWS entry and I'll merge this. Thanks!

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a 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.

class MySignature(inspect.Signature): pass
class foo: pass
foo_sig = MySignature.from_callable(foo)
self.assertTrue(isinstance(foo_sig, MySignature))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use assertIsinstance().

Copy link
Author

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.

Copy link
Member

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.

@bukzor
Copy link
Author

bukzor commented Sep 22, 2018

Please add a NEWS entry and I'll merge this. Thanks!

I did see that notice, but couldn't figure out what to write, or whether this change is notable.
I was hoping that a maintainer would add it to my PR, since I've allowed edits.

What should the NEWS entry say? "Preserve subclassing in Signature.from_callable" ?

terryjreedy and others added 18 commits September 4, 2019 20:20
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.
)

* Rename PyThreadState_DeleteCurrent()
  to _PyThreadState_DeleteCurrent()
* Move it to the internal C API

Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
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.
@the-knights-who-say-ni
Copy link

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 Missing

Our records indicate the following people have not signed the CLA:

@mrkn

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
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@gpshead
Copy link
Member

gpshead commented Sep 13, 2019

my push failed to do the right thing, i'll re-create this PR.

@gpshead gpshead closed this Sep 13, 2019
gpshead added a commit that referenced this pull request Sep 13, 2019
…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.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 13, 2019
…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>
matrixise pushed a commit that referenced this pull request Sep 13, 2019
…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>
matrixise pushed a commit that referenced this pull request Sep 13, 2019
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.