אלעזר wrote:
class Starship(tuple):
damage: int = 0
captain: str = "Kirk"
Is an obvious syntax for
Starship = NamedTuple('Starship', [('damage', int), ('captain', str)])
But the untyped version of that already has a meaning --
it's a tuple subclass with two extra class attributes
that are unrelated to its indexable items.
I thought that type annotations weren't meant to change
runtime semantics?
--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/