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 levkivskyi
Recipients elazar, gvanrossum, levkivskyi, rhettinger
Date 2017-01-24.08:41:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485247314.78.0.806205583432.issue29357@psf.upfronthosting.co.za>
In-reply-to
Content
This has been already reported in https://github.com/python/typing/issues/352 and fixed in https://hg.python.org/cpython/rev/f100619e7137 and https://github.com/python/typing/pull/364

Now adding new methods works but overwriting existing special attributes raises AttributeError:

class A(NamedTuple):
    x: int
    def spam(self):  # this works
        ...
    def _fields(self):  # this is an error (and also for __repr__ etc)

If you think that overwriting all special attributes should be allowed (or only some of them) then we could discuss this at python/typing tracker.
History
Date User Action Args
2017-01-24 08:41:54levkivskyisetrecipients: + levkivskyi, gvanrossum, rhettinger, elazar
2017-01-24 08:41:54levkivskyisetmessageid: <1485247314.78.0.806205583432.issue29357@psf.upfronthosting.co.za>
2017-01-24 08:41:54levkivskyilinkissue29357 messages
2017-01-24 08:41:54levkivskyicreate