Author ncoghlan
Recipients Arfrever, eltoder, eric.snow, ncoghlan, njs, rhettinger, trent
Date 2017-12-25.23:58:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514246304.17.0.213398074469.issue24991@psf.upfronthosting.co.za>
In-reply-to
Content
Declaring "I intend for instances of this class to be immutable" isn't a fuzzy concept - it's in the same vein as other type hints, like "I intend for this to be a string". The part that's fuzzy is how well Python actually enforces that declaration, and hence the degree to which you can actually rely on it at runtime.

In most cases, detecting and reporting *violations* of that intent would be in the realm of typecheckers rather than the language interpeter, but there'd be cases where the interpreter itself could make useful inferences from such a declaration (for example, by prohibiting conventional mutation operations, the way "frozen=True" does for data classes).
History
Date User Action Args
2017-12-25 23:58:24ncoghlansetrecipients: + ncoghlan, rhettinger, trent, Arfrever, njs, eltoder, eric.snow
2017-12-25 23:58:24ncoghlansetmessageid: <1514246304.17.0.213398074469.issue24991@psf.upfronthosting.co.za>
2017-12-25 23:58:24ncoghlanlinkissue24991 messages
2017-12-25 23:58:24ncoghlancreate