Island: Annotate MachineID as a TypeAlias

See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
This commit is contained in:
Mike Salvatore 2022-08-29 13:50:12 -04:00
parent 1deb03b6d7
commit 4662dd8bed
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
from ipaddress import IPv4Interface from ipaddress import IPv4Interface
from typing import Optional, Sequence from typing import Optional, Sequence, TypeAlias
from pydantic import Field, PositiveInt, validator from pydantic import Field, PositiveInt, validator
@ -8,7 +8,7 @@ from common.base_models import MutableInfectionMonkeyBaseModel
from common.transforms import make_immutable_sequence from common.transforms import make_immutable_sequence
from common.types import HardwareID from common.types import HardwareID
MachineID = PositiveInt MachineID: TypeAlias = PositiveInt
class Machine(MutableInfectionMonkeyBaseModel): class Machine(MutableInfectionMonkeyBaseModel):