Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GH-100242: bring functools.py partial implementation more in line with C code #100244

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 4 commits into from
Apr 17, 2024

Conversation

cfbolz
Copy link
Contributor

@cfbolz cfbolz commented Dec 14, 2022

in partial.__new__, before checking for the existence of the attribute 'func', first check whether the argument is an instance of partial.

in partial.__new__, before checking for the existence of the attribute
'func', first check whether the argument is an instance of partial.
@netlify
Copy link

netlify bot commented Dec 14, 2022

Deploy Preview for python-cpython-preview canceled.

Name Link
🔨 Latest commit 97b9966
🔍 Latest deploy log https://app.netlify.com/sites/python-cpython-preview/deploys/6399fa45bbd72a0008fec2cf

@rhettinger rhettinger self-assigned this Dec 15, 2022
@rhettinger
Copy link
Contributor

As a first approximation this looks good. In the next couple of days, I can devote some time to give it more thought.

@cfbolz
Copy link
Contributor Author

cfbolz commented May 29, 2023

@rhettinger very gentle ping, would you maybe have some time to look into this PR?

Copy link
Contributor

@ambv ambv left a comment

Choose a reason for hiding this comment

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

The only risk I'm seeing here is the subtle change that now allows a subclass of functools.partial with an overriden __call__ whereas this would be rejected before in the C version.

As long as we accept this change for 3.13 alone, this is uncontroversial. As for whether this should land in 3.12.4, I'm leaving this question open. My intuition says it's fine.

@ambv ambv merged commit 5a0209f into python:main Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants