Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
serhiy-storchaka merged 2 commits intopython:mainfromserhiy-storchaka:partial-get
Jul 3, 2024

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedJun 27, 2024
edited by github-actionsbot
Loading

@nineteendo
Copy link
Contributor

nineteendo commentedJun 27, 2024
edited
Loading

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>
@@ -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:
Copy link
MemberAuthor

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.

@serhiy-storchakaserhiy-storchaka merged commitff5806c intopython:mainJul 3, 2024
38 checks passed
@serhiy-storchakaserhiy-storchaka deleted the partial-get branchJuly 3, 2024 06:02
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 Ubuntu NoGIL Refleaks 3.x has failed when building commitff5806c.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1226/builds/2167) and take a look at the build logs.
  4. Check if the failure is related to this commit (ff5806c) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1226/builds/2167

Failed tests:

  • test.test_concurrent_futures.test_thread_pool

Failed subtests:

  • test_free_reference - test.test_concurrent_futures.test_thread_pool.ThreadPoolExecutorTest.test_free_reference

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/test_concurrent_futures/executor.py", line130, intest_free_referenceself.assertIsNone(wr())~~~~~~~~~~~~~~~~~^^^^^^AssertionError:<test.test_concurrent_futures.executor.MyObject object at 0x20002080170> is not NoneTraceback (most recent call last):  File"/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.refleak.nogil/build/Lib/test/test_concurrent_futures/executor.py", line130, intest_free_referenceself.assertIsNone(wr())~~~~~~~~~~~~~~~~~^^^^^^AssertionError:<test.test_concurrent_futures.executor.MyObject object at 0x20006090090> is not None

noahbkim pushed a commit to hudson-trading/cpython that referenced this pull requestJul 11, 2024
pythonGH-121089)Co-authored-by: d.grigonis <dgrigonis@users.noreply.github.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
pythonGH-121089)Co-authored-by: d.grigonis <dgrigonis@users.noreply.github.com>
JelleZijlstra added a commit that referenced this pull requestSep 29, 2024
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
Copy link

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 .

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dg-pbdg-pbdg-pb left review comments

@rhettingerrhettingerrhettinger approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@serhiy-storchaka@nineteendo@bedevere-bot@MegaIng@rhettinger@dg-pb

[8]ページ先頭

©2009-2025 Movatter.jp