From 4662dd8bed9cebc8967d34b541dae2b571826428 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 29 Aug 2022 13:50:12 -0400 Subject: [PATCH] Island: Annotate MachineID as a TypeAlias See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases --- monkey/monkey_island/cc/models/machine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/models/machine.py b/monkey/monkey_island/cc/models/machine.py index 0c68f0b04..77000c39a 100644 --- a/monkey/monkey_island/cc/models/machine.py +++ b/monkey/monkey_island/cc/models/machine.py @@ -1,5 +1,5 @@ from ipaddress import IPv4Interface -from typing import Optional, Sequence +from typing import Optional, Sequence, TypeAlias 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.types import HardwareID -MachineID = PositiveInt +MachineID: TypeAlias = PositiveInt class Machine(MutableInfectionMonkeyBaseModel):