GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-89519: Remove classmethod descriptor chaining, deprecated since 3.11 by rhettinger · Pull Request #110163 · python/cpython

Conversation

@rhettinger

@rhettinger rhettinger commented Sep 30, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Calling help executes @classmethod @property decorated methods #89519

📚 Documentation preview 📚: https://cpython-previews--110163.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rhettinger
pythongh-89519: Remove classmethod descriptor chaining, deprecated si…
1f9686f
…nce 3.11
@rhettinger rhettinger added type-bug An unexpected behavior, bug, or error 3.13 only security fixes labels Sep 30, 2023
@bedevere-app bedevere-app Bot added the awaiting review label Sep 30, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Sep 30, 2023
Calling help executes @classmethod @property decorated methods #89519
Closed
rhettinger added 2 commits September 30, 2023 17:30
@rhettinger
Add blurb
340d20f
@rhettinger
Remove doctests for classmethod descriptor chaining
155fdf2
@rhettinger

rhettinger commented Oct 1, 2023

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rhettinger and others added 2 commits October 2, 2023 11:40
@rhettinger
Complete the emulation of MethodType.
8336eb0
@rhettinger
Merge branch 'main' into remove_classmethod_descriptor_chaining
a7b0830
@KevinMGranger

KevinMGranger commented Oct 23, 2023

Copy link
Copy Markdown

Will this break the pattern described as an alternative to abc.abstractclassmethod?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rhettinger

rhettinger commented Oct 24, 2023

Copy link
Copy Markdown
Contributor Author

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

facebook-github-bot pushed a commit to facebookincubator/MetaPython that referenced this pull request Oct 25, 2023
@itamaro @facebook-github-bot
GH-89519: Remove classmethod descriptor chaining, deprecated since 3.…
6f02c7f
…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

itamaro commented Oct 26, 2023

Copy link
Copy Markdown
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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rhettinger

rhettinger commented Oct 27, 2023

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rhettinger
Merge branch 'main' into remove_classmethod_descriptor_chaining
291ed52
@rhettinger rhettinger added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 27, 2023
@bedevere-bot

bedevere-bot commented Oct 27, 2023

Copy link
Copy Markdown

🤖 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 27, 2023
@rhettinger
rhettinger merged commit 7f9a99e into python:main Oct 27, 2023
@bedevere-app bedevere-app Bot removed the awaiting review label Oct 27, 2023
@rhettinger
rhettinger deleted the remove_classmethod_descriptor_chaining branch October 27, 2023 05:25
facebook-github-bot pushed a commit to facebookincubator/MetaPython that referenced this pull request Dec 22, 2023
@itamaro @facebook-github-bot
gh-89519 & gh-113157 (Remove classmethod descriptor chaining, depreca…
f508768
…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
@rhettinger @aisk
pythongh-89519: Remove classmethod descriptor chaining, deprecated si…
c63736d
…nce 3.11 (pythongh-110163)
@0Hughman0 0Hughman0 mentioned this pull request Jul 9, 2024
CachedClassProps and CachedProp really don't play well with any tooling. 0Hughman0/Cassini#86
Closed
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@rhettinger @Glyphack
pythongh-89519: Remove classmethod descriptor chaining, deprecated si…
e3d33d5
…nce 3.11 (pythongh-110163)
@chrisimcevoy chrisimcevoy mentioned this pull request Sep 20, 2025
PyCharm gets confused about metaclass properties chrisimcevoy/pyoda-time#159
Open
copybara-service Bot pushed a commit to google/fiddle that referenced this pull request Jan 12, 2026
@oprypin @copybara-github
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with …
1b9fda6
…a new dedicated `AutoConfigClassMethod` descriptor.

This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163

PiperOrigin-RevId: 855235679
@copybara-service copybara-service Bot mentioned this pull request Jan 12, 2026
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with a new dedicated AutoConfigClassMethod descriptor. google/fiddle#598
Merged
copybara-service Bot pushed a commit to google/fiddle that referenced this pull request Jan 12, 2026
@oprypin @copybara-github
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with …
67c2eb6
…a new dedicated `AutoConfigClassMethod` descriptor.

This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163

PiperOrigin-RevId: 855235679
copybara-service Bot pushed a commit to google/fiddle that referenced this pull request Jan 13, 2026
@oprypin @copybara-github
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with …
01c6891
…a new dedicated `AutoConfigClassMethod` descriptor.

This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163

PiperOrigin-RevId: 855235679
copybara-service Bot pushed a commit to google/fiddle that referenced this pull request Jan 13, 2026
@oprypin @copybara-github
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with …
803ea8e
…a new dedicated `AutoConfigClassMethod` descriptor.

This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163

PiperOrigin-RevId: 855235679
copybara-service Bot pushed a commit to google/fiddle that referenced this pull request Jan 15, 2026
@oprypin @copybara-github
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with …
1f05ce1
…a new dedicated `AutoConfigClassMethod` descriptor.

This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163

PiperOrigin-RevId: 855235679
copybara-service Bot pushed a commit to google/fiddle that referenced this pull request Jan 15, 2026
@oprypin @copybara-github
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with …
f459007
…a new dedicated `AutoConfigClassMethod` descriptor.

This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163

PiperOrigin-RevId: 855235679
copybara-service Bot pushed a commit to google/fiddle that referenced this pull request Jan 15, 2026
@oprypin @copybara-github
Prepare for Python 3.13: replace classmethod(AutoConfig(...)) with …
3d956df
…a new dedicated `AutoConfigClassMethod` descriptor.

This is necessary because Python 3.13 no longer recognizes descriptor chaining: python/cpython#110163

PiperOrigin-RevId: 856608179
@ambv ambv mentioned this pull request Oct 20, 2026
gh-89519: Emit a warning when classmethod() wraps a non-callable descriptor #92426
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

3.13 only security fixes type-bug An unexpected behavior, bug, or error

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@rhettinger @KevinMGranger @itamaro @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.