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
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)'