Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-121027: Make the functools.partial object a method descriptor#121089
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
serhiy-storchaka commented Jun 27, 2024 • edited by github-actions bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by github-actions bot
Uh oh!
There was an error while loading. Please reload this page.
5ecccee to 693fbc7Comparenineteendo commented Jun 27, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
This should have been labeled as "DO-NOT-MERGE" until #121086 was merged. There are conflicts anyway now. |
Co-authored-by: d.grigonis <dgrigonis@users.noreply.github.com>
693fbc7 to d752505CompareUh oh!
There was an error while loading. Please reload this page.
| get=getattr(self.func, "__get__", None) | ||
| result=None | ||
| ifgetisnotNoneandnotisinstance(self.func, partial): | ||
| ifgetisnotNone: |
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.
It was needed to avoid emitting a warning for partialmethod(partial(...)), even if the final behavior is not changed.
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot commented Jul 3, 2024
|
pythonGH-121089) Co-authored-by: d.grigonis <dgrigonis@users.noreply.github.com>
pythonGH-121089) Co-authored-by: d.grigonis <dgrigonis@users.noreply.github.com>
PR #121089 added an eager import for types.MethodType, but still left the existing hacks for lazily importing from types. We could also create MethodType internally in functools.py (e.g., by using `type(Placeholder.__repr__)`, but it feels not worth it at this point, so instead I unlazified all the usages of types in the module.
MegaIng commented Oct 25, 2024
May I ask why this change was considered critical enough to not follow PEP 387? It is clearly backwards incompatible and is in fact breaking code, see lark-parser/lark#1480 . |
Co-authored-by: d.grigonis dgrigonis@users.noreply.github.com
📚 Documentation preview 📚: https://cpython-previews--121089.org.readthedocs.build/