Skip to content

classmethod wrapping a property no longer works in Python 3.13 #119628

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
treyhunner opened this issue May 27, 2024 · 2 comments
Closed

classmethod wrapping a property no longer works in Python 3.13 #119628

treyhunner opened this issue May 27, 2024 · 2 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@treyhunner
Copy link
Member

treyhunner commented May 27, 2024

Bug report

Bug description:

In Python 3.12 and below, wrapping a property object with the classmethod decorator would result in a descriptor object that would act like a class-level property.

Here is the code to check this:

class A:
    @classmethod
    @property
    def b(self):
        return 4

print(f"{A.b = }")

On Python 3.12 this prints 4.

On Python 3.13 this currently prints <bound method b of <class '__main__.A'>>.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@treyhunner treyhunner added the type-bug An unexpected behavior, bug, or error label May 27, 2024
@Eclips4
Copy link
Member

Eclips4 commented May 27, 2024

Probably related: #89519

@serhiy-storchaka
Copy link
Member

This feature was deprecated in 3.11 and removed in 3.13.

@serhiy-storchaka serhiy-storchaka closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants