From 5ab31cae4ecd3e5943844c11e7837f42f85da441 Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Fri, 20 Oct 2023 15:12:57 +0200 Subject: [PATCH] fix: python 3.8 compatibility - dict typing --- .../_onthology_classes/_object_classes.py | 6 +++--- .../validate_onthology/_onthology_classes/_onthology.py | 2 +- .../validate_onthology/_onthology_classes/_sensor_type.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_object_classes.py b/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_object_classes.py index c335237..c4ede47 100644 --- a/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_object_classes.py +++ b/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_object_classes.py @@ -12,8 +12,8 @@ @dataclass class _ObjectClass: - attributes: dict[str, t.Type[_Attribute]] - sensor_types: dict[raillabel.format.SensorType, _SensorType] + attributes: t.Dict[str, t.Type[_Attribute]] + sensor_types: t.Dict[raillabel.format.SensorType, _SensorType] @classmethod def fromdict(cls, data_dict: dict) -> "_ObjectClass": @@ -103,7 +103,7 @@ def _check_false_attribute_type( def _compile_applicable_attributes( self, annotation: t.Type[raillabel.format._ObjectAnnotation] - ) -> dict[str, t.Type[_Attribute]]: + ) -> t.Dict[str, t.Type[_Attribute]]: applicable_attributes = self.attributes diff --git a/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_onthology.py b/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_onthology.py index c78526c..15e319e 100644 --- a/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_onthology.py +++ b/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_onthology.py @@ -11,7 +11,7 @@ @dataclass class _Onthology: - classes: dict[str, _ObjectClass] + classes: t.Dict[str, _ObjectClass] @classmethod def fromdict(cls, data_dict: dict) -> "_Onthology": diff --git a/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_sensor_type.py b/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_sensor_type.py index 7bf7258..a74960b 100644 --- a/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_sensor_type.py +++ b/raillabel_providerkit/validation/validate_onthology/_onthology_classes/_sensor_type.py @@ -9,7 +9,7 @@ @dataclass class _SensorType: - attributes: dict[str, t.Type[_Attribute]] + attributes: t.Dict[str, t.Type[_Attribute]] @classmethod def fromdict(cls, data_dict: dict) -> "_SensorType":