[issue29357] New NamedTuple syntax silently ignores method definitions

2017-01-24 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: 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

[issue29357] New NamedTuple syntax silently ignores method definitions

2017-01-23 Thread Elazar Gershuni
New submission from Elazar Gershuni: The following does not work as expected: ``` from typing import NamedTuple class A(NamedTuple): a: int def __repr__(self): return 'some A' def spam(self): print('spam!') >>> a = A(5) >>> repr(a) # should be 'some A' 'A(a=5)'