[issue35098] Deleting __new__ does not restore previous behavior

Steven D'Aprano report at bugs.python.org
Sun Oct 28 21:29:58 EDT 2018


Steven D'Aprano <steve+python at pearwood.info> added the comment:

I think the real WTF here is that you can write to arbitrary dunder attributes even if they aren't listed in __slots__.

py> Color.__NOBODY_expects_the_Spanish_Inquisition__ = "What?"
py> Color.__NOBODY_expects_the_Spanish_Inquisition__
'What?'

I think that assigning to Color.__new__ should have failed in the first place.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35098>
_______________________________________


More information about the Python-bugs-list mailing list