This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author NeilGirdhar
Recipients NeilGirdhar
Date 2022-02-12.11:15:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644664548.7.0.814482728123.issue46730@roundup.psfhosted.org>
In-reply-to
Content
class C:
    @property
    def f(self) -> int:
        return 2

class D(C):
    pass

D().f = 2

Gives:

Traceback (most recent call last):
  File "/home/neil/src/cmm/a.py", line 10, in <module>
    D().f = 2
AttributeError: can't set attribute 'f'

This can be a pain to debug when the property is buried in a base class.  Would it make sense to mention the reason why the attribute can't be set, namely that it's on a property without a setter?
History
Date User Action Args
2022-02-12 11:15:48NeilGirdharsetrecipients: + NeilGirdhar
2022-02-12 11:15:48NeilGirdharsetmessageid: <1644664548.7.0.814482728123.issue46730@roundup.psfhosted.org>
2022-02-12 11:15:48NeilGirdharlinkissue46730 messages
2022-02-12 11:15:48NeilGirdharcreate