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-89519: Remove classmethod descriptor chaining, deprecated since 3.11#110163

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

Conversation

rhettinger
Copy link
Contributor

@rhettingerrhettinger commentedSep 30, 2023
edited by github-actionsbot
Loading

@rhettingerrhettinger added type-bugAn unexpected behavior, bug, or error 3.13bugs and security fixes labelsSep 30, 2023
@rhettinger
Copy link
ContributorAuthor

I'm still working on the doctest for the descriptor howto. It looks like the classmethod emulation is imperfect after the classproperty has been removed.

@KevinMGranger
Copy link

@rhettinger
Copy link
ContributorAuthor

@KevinMGranger The examples for combiningabstractmethod withclassmethod andstaticmethod will still work. This is tested intest_abstractclassmethod_basics() inLib/test/test_abc. Also, here's a live demonstration:

% ./python.exePython 3.13.0a0 (heads/remove_classmethod_descriptor_chaining:8336eb0b87, Oct 24 2023, 14:41:05) [Clang 15.0.0 (clang-1500.0.40.1)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> from abc import ABC, abstractmethod>>> class C(ABC):...     @classmethod...     @abstractmethod...     def my_abstract_classmethod(cls, arg):...         ......>>> C()Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: Can't instantiate abstract class C without an implementation for abstract method 'my_abstract_classmethod'

Note, these examples have worked since Python 3.3 which was long before the broken descriptor chaining arrived in Python 3.9. So, they are independent of the change being reverted. Thanks for asking.

facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull requestOct 25, 2023
…11 (#110163)Summary: backporting [Raymond Hettinger's `remove_classmethod_descriptor_chaining` branch](https://github.com/rhettinger/cpython/tree/remove_classmethod_descriptor_chaining) (pending upstream PR [GH-110163](python/cpython#110163)), part of upstream issue [GH-89519](python/cpython#89519)Reviewed By: swtaarrsDifferential Revision: D50534886fbshipit-source-id: 05b29193ce220f0d91fd0df8d5cef34d7e923456
@itamaro
Copy link
Contributor

Looking forward to see this getting merged!

fwiw, I ran into an issue related to classmethod descriptor chaining in the Meta codebase -- some code (that was written for Python 3.8, doing a bunch of signature and type inspection of decorated methods) started breaking under Python 3.10.
I backported the deprecation from 3.11 and this removal into Cinder 3.10, and it resolved the issue.

If it helps with confidence in the removal - this PR (cleanly backported to 3.10) is running in production (in Instagram and other Meta Python services), after all internal test suites passed (including the full Instagram test suite).

@rhettinger
Copy link
ContributorAuthor

@itamaro Thank you for your comment. Indeed, it does increase the confidence in the PR.

@rhettingerrhettinger added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelOct 27, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@rhettinger for commit291ed52 🤖

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelOct 27, 2023
@rhettingerrhettinger merged commit7f9a99e intopython:mainOct 27, 2023
@rhettingerrhettinger deleted the remove_classmethod_descriptor_chaining branchOctober 27, 2023 05:25
facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull requestDec 22, 2023
…ted since 3.11)Summary:backport upstream PRspython/cpython#110163 andpython/cpython#113233upstream issues:python/cpython#89519 (Calling help executes classmethod property decorated methods) andpython/cpython#113157 (Changed behavior of <instancemethod>.__get__ in Python 3.11)upstream commits: [`7f9a99e8549b792662f2cd28bf38a4d4625bd402`](python/cpython@7f9a99e) and [`d058eaeed44766a8291013b275ad22f153935d3b`](python/cpython@d058eae)Reviewed By: aleivagDifferential Revision: D52014322fbshipit-source-id: 87de6d9587bd9cc49f053ca340adfc469b041f91
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@rhettinger@KevinMGranger@itamaro@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp