How can namedtuples be extended or subclassed with many additional @properties ?
For a few, one can just write the text below; but there are many,
so I\'m looking for a gene
The answer to your question
How can namedtuples be extended or subclassed with additional
@properties
?
is: exactly the way you're doing it! What error are you getting? To see a simpler case,
>>> class x(collections.namedtuple('y', 'a b c')):
... @property
... def d(self): return 23
...
>>> a=x(1, 2, 3)
>>> a.d
23
>>>