Skip to content

Commit fde3776

Browse files
committed
model.KeyTypes: Ignore mypy errors for abstract classes to be compliant
Mypy appears to not like abstract classes in a context where only concrete classes should be given: ``` Only concrete class can be given where "tuple[type[Referable], KeyTypes]" is expected ``` However, the spec demands the four abstract classes - `Event` - `DataElement` - `SubmodelElement` - `SubmodelElementCollection` to appear inside the `model.KeyTypes` Enum. Therefore, we ignore these errors via `# type: ignore`.
1 parent 9dd5a87 commit fde3776

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

basyx/aas/model/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
ConceptDictionary: KeyElements.CONCEPT_DICTIONARY,
5454
Entity: KeyElements.ENTITY,
5555
BasicEvent: KeyElements.BASIC_EVENT,
56-
Event: KeyElements.EVENT,
56+
Event: KeyElements.EVENT, # type: ignore
5757
Blob: KeyElements.BLOB,
5858
File: KeyElements.FILE,
5959
Operation: KeyElements.OPERATION,
@@ -62,9 +62,9 @@
6262
MultiLanguageProperty: KeyElements.MULTI_LANGUAGE_PROPERTY,
6363
Range: KeyElements.RANGE,
6464
ReferenceElement: KeyElements.REFERENCE_ELEMENT,
65-
DataElement: KeyElements.DATA_ELEMENT,
66-
SubmodelElementCollection: KeyElements.SUBMODEL_ELEMENT_COLLECTION,
65+
DataElement: KeyElements.DATA_ELEMENT, # type: ignore
66+
SubmodelElementCollection: KeyElements.SUBMODEL_ELEMENT_COLLECTION, # type: ignore
6767
AnnotatedRelationshipElement: KeyElements.ANNOTATED_RELATIONSHIP_ELEMENT,
6868
RelationshipElement: KeyElements.RELATIONSHIP_ELEMENT,
69-
SubmodelElement: KeyElements.SUBMODEL_ELEMENT,
69+
SubmodelElement: KeyElements.SUBMODEL_ELEMENT, # type: ignore
7070
}

0 commit comments

Comments
 (0)