Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python 3.13 property() now inherits __name__ from callable

While trying to build Pyramid with Python 3.13b2 I see some tests are failing.
The problem seems to be a change in Python behavior.

With Python 3.12 I get:

>>> def worker(obj):
...     pass
...
>>> hasattr(property(worker), '__name__')
False

While Python 3.13 returns:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>>> def worker(obj):
...     pass
...
>>> hasattr(property(worker), '__name__')
True
>>> property(worker).__name__
'worker'

I’ve filed a bug report to Pyramid, but I’m unsure if the correct behavior is the one from 3.12 or it is from 3.13. Should I file a bug against Python instead?

>Solution :

This is a deliberate change, visible in the Python changelog under Python 3.13.0 alpha 5:

  • gh-101860: Expose __name__ attribute on property.

(It’d be pretty unlikely to make this kind of change by accident.)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading