Skip to content

Commit

Permalink
Changed union type syntax for all other occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
nbes4 committed May 7, 2024
1 parent ce805f7 commit a6759c7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions entities/attribute.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, Union

from entities.common import EnumValue, Value

Expand Down Expand Up @@ -47,7 +47,7 @@ class CapacitanceUnit(AttributeUnit):


class CapacitanceAttribute(Attribute):
def __init__(self, name: str, value: Value | str, unit: CapacitanceUnit) -> None:
def __init__(self, name: str, value: Union[Value, str], unit: CapacitanceUnit) -> None:
super().__init__(name, value, AttributeType.CAPACITANCE, unit)


Expand All @@ -62,7 +62,7 @@ class CurrentUnit(AttributeUnit):


class CurrentAttribute(Attribute):
def __init__(self, name: str, value: Value | str, unit: CurrentUnit) -> None:
def __init__(self, name: str, value: Union[Value, str], unit: CurrentUnit) -> None:
super().__init__(name, value, AttributeType.CURRENT, unit)


Expand All @@ -76,7 +76,7 @@ class FrequencyUnit(AttributeUnit):


class FrequencyAttribute(Attribute):
def __init__(self, name: str, value: Value | str, unit: FrequencyUnit) -> None:
def __init__(self, name: str, value: Union[Value, str], unit: FrequencyUnit) -> None:
super().__init__(name, value, AttributeType.FREQUENCY, unit)


Expand All @@ -88,7 +88,7 @@ class InductanceUnit(AttributeUnit):


class InductanceAttribute(Attribute):
def __init__(self, name: str, value: Value | str, unit: InductanceUnit) -> None:
def __init__(self, name: str, value: Union[Value, str], unit: InductanceUnit) -> None:
super().__init__(name, value, AttributeType.INDUCTANCE, unit)


Expand All @@ -103,7 +103,7 @@ class PowerUnit(AttributeUnit):


class PowerAttribute(Attribute):
def __init__(self, name: str, value: Value | str, unit: PowerUnit) -> None:
def __init__(self, name: str, value: Union[Value, str], unit: PowerUnit) -> None:
super().__init__(name, value, AttributeType.POWER, unit)


Expand All @@ -116,7 +116,7 @@ class ResistanceUnit(AttributeUnit):


class ResistanceAttribute(Attribute):
def __init__(self, name: str, value: Value | str, unit: ResistanceUnit) -> None:
def __init__(self, name: str, value: Union[Value, str], unit: ResistanceUnit) -> None:
super().__init__(name, value, AttributeType.RESISTANCE, unit)


Expand All @@ -130,10 +130,10 @@ class VoltageUnit(AttributeUnit):


class VoltageAttribute(Attribute):
def __init__(self, name: str, value: Value | str, unit: VoltageUnit) -> None:
def __init__(self, name: str, value: Union[Value, str], unit: VoltageUnit) -> None:
super().__init__(name, value, AttributeType.VOLTAGE, unit)


class StringAttribute(Attribute):
def __init__(self, name: str, value: Value | str) -> None:
def __init__(self, name: str, value: Union[Value, str]) -> None:
super().__init__(name, value, AttributeType.STRING, None)

0 comments on commit a6759c7

Please sign in to comment.