Skip to content

Conversation

@rhettinger
Copy link
Contributor

@rhettingerrhettinger commented Sep 30, 2023

@rhettingerrhettinger added type-bug An unexpected behavior, bug, or error 3.13 bugs and security fixes labels Sep 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 combining abstractmethod with classmethod and staticmethod will still work. This is tested in test_abstractclassmethod_basics() in Lib/test/test_abc. Also, here's a live demonstration:

% ./python.exe Python 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 darwin Type "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 request Oct 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: swtaarrs Differential Revision: D50534886 fbshipit-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-buildbots Test PR w/ buildbots; report in status section label Oct 27, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @rhettinger for commit 291ed52 🤖

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 27, 2023
@rhettingerrhettinger merged commit 7f9a99e into python:mainOct 27, 2023
@rhettingerrhettinger deleted the remove_classmethod_descriptor_chaining branch October 27, 2023 05:25
facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull request Dec 22, 2023
…ted since 3.11) Summary: backport upstream PRs python/cpython#110163 and python/cpython#113233 upstream issues: python/cpython#89519 (Calling help executes classmethod property decorated methods) and python/cpython#113157 (Changed behavior of <instancemethod>.__get__ in Python 3.11) upstream commits: [`7f9a99e8549b792662f2cd28bf38a4d4625bd402`](python/cpython@7f9a99e) and [`d058eaeed44766a8291013b275ad22f153935d3b`](python/cpython@d058eae) Reviewed By: aleivag Differential Revision: D52014322 fbshipit-source-id: 87de6d9587bd9cc49f053ca340adfc469b041f91
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
copybara-servicebot pushed a commit to google/fiddle that referenced this pull request Jan 12, 2026
…a new dedicated `AutoConfigClassMethod` descriptor. This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163 PiperOrigin-RevId: 855235679
copybara-servicebot pushed a commit to google/fiddle that referenced this pull request Jan 12, 2026
…a new dedicated `AutoConfigClassMethod` descriptor. This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163 PiperOrigin-RevId: 855235679
copybara-servicebot pushed a commit to google/fiddle that referenced this pull request Jan 13, 2026
…a new dedicated `AutoConfigClassMethod` descriptor. This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163 PiperOrigin-RevId: 855235679
copybara-servicebot pushed a commit to google/fiddle that referenced this pull request Jan 13, 2026
…a new dedicated `AutoConfigClassMethod` descriptor. This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163 PiperOrigin-RevId: 855235679
copybara-servicebot pushed a commit to google/fiddle that referenced this pull request Jan 15, 2026
…a new dedicated `AutoConfigClassMethod` descriptor. This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163 PiperOrigin-RevId: 855235679
copybara-servicebot pushed a commit to google/fiddle that referenced this pull request Jan 15, 2026
…a new dedicated `AutoConfigClassMethod` descriptor. This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163 PiperOrigin-RevId: 855235679
copybara-servicebot pushed a commit to google/fiddle that referenced this pull request Jan 15, 2026
…a new dedicated `AutoConfigClassMethod` descriptor. This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163 PiperOrigin-RevId: 856608179
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rhettinger@KevinMGranger@itamaro@bedevere-bot