Hacker News new | ask | show | jobs
by caioariede 2979 days ago
Also, AFAIK you cannot add methods to NamedTuple, making it much less flexible than data classes.
1 comments

One of the examples in the documentation uses a method. https://docs.python.org/3/library/typing.html#typing.NamedTu...
Yeah, you're right. You just cannot overwrite __init__:

> AttributeError: Cannot overwrite NamedTuple attribute __init__