Closed
Description
Instead of
OutputKey = collections.namedtuple("OutputKey", ["label", "position"])
we can do
from typing import NamedTuple
class OutputKey(NamedTuple)
label
position
The advantage is that like this we can add type hints to the various elements, such as
from typing import NamedTuple
class OutputKey(NamedTuple)
label: Hashable
position: int
See https://docs.python.org/3/library/typing.html#typing.NamedTuple for reference