-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Closed
Labels
Typingtype annotations, mypy/pyright type checkingtype annotations, mypy/pyright type checkinggood first issue
Description
Instead of
OutputKey = collections.namedtuple("OutputKey", ["label", "position"])we can do
from typing import NamedTuple
class OutputKey(NamedTuple)
label
positionThe 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: intSee https://docs.python.org/3/library/typing.html#typing.NamedTuple for reference
Metadata
Metadata
Assignees
Labels
Typingtype annotations, mypy/pyright type checkingtype annotations, mypy/pyright type checkinggood first issue