Closed
Description
Bug report
Right now only collections.namedtuple
is tested:
Lines 937 to 946 in b1aebf1
@serhiy-storchaka noted in #108752 (comment) that only named tuples created by collections.namedtuple()
are supported. But, since typing.NamedTuple
uses collections.namedtuple
inside:
Lines 2695 to 2696 in b1aebf1
>>> import typing
>>>
>>> class N(typing.NamedTuple):
... x: int
... y: int
...
>>> N.__replace__
<function N._replace at 0x10580a210>
>>> import copy
>>> copy.replace(N(1, 2), x=3)
N(x=3, y=2)
I have a PR ready with extra tests.