Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
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 ourterms of service andprivacy 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
nineteendo commentedJun 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>
Uh oh!
There was an error while loading.Please reload this page.
@@ -402,7 +398,7 @@ def _method(cls_or_self, /, *args, **keywords): | |||
def __get__(self, obj, cls=None): | |||
get = getattr(self.func, "__get__", None) | |||
result = None | |||
if get is not None and not isinstance(self.func, partial): | |||
if get is not None: |
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 forpartialmethod(partial(...))
, even if the final behavior is not changed.
Uh oh!
There was an error while loading.Please reload this page.
ff5806c
intopython:mainUh oh!
There was an error while loading.Please reload this page.
bedevere-bot commentedJul 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, butstill 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 atthis point, so instead I unlazified all the usages of types in themodule.
MegaIng commentedOct 25, 2024
May I ask why this change was considered critical enough to not followPEP 387? It is clearly backwards incompatible and is in fact breaking code, seelark-parser/lark#1480 . |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: d.grigonisdgrigonis@users.noreply.github.com
📚 Documentation preview 📚:https://cpython-previews--121089.org.readthedocs.build/