Skip to content

Commit

Permalink
backport: backend, model: remove calls to trivial super().__init__() …
Browse files Browse the repository at this point in the history
…methods (#262)

These are unsafe, according to mypy:
```
error: Call to abstract method "__init__" of "DataSpecificationContent" with trivial body via super() is unsafe  [safe-super]
```

This is a backport of #261.
  • Loading branch information
jkhsjdhjs authored May 10, 2024
1 parent cdbd2db commit a520467
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion basyx/aas/backend/couchdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ def __init__(self, url: str, database: str):
:param url: URL to the CouchDB
:param database: Name of the Database inside the CouchDB
"""
super().__init__()
self.url: str = url
self.database_name: str = database

Expand Down
1 change: 0 additions & 1 deletion basyx/aas/backend/local_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __init__(self, directory_path: str):
:param directory_path: Path to the local file backend (the path where you want to store your AAS JSON files)
"""
super().__init__()
self.directory_path: str = directory_path.rstrip("/")

# A dictionary of weak references to local replications of stored objects. Objects are kept in this cache as
Expand Down
2 changes: 0 additions & 2 deletions basyx/aas/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,6 @@ def __init__(self,
"""
TODO: Add instruction what to do after construction
"""
super().__init__()
self.depends_on: Set[Reference] = set() if depends_on is None else depends_on


Expand All @@ -894,7 +893,6 @@ def __init__(self,
"""
TODO: Add instruction what to do after construction
"""
super().__init__()
self.type: QualifierType = type_
self.value_type: Type[datatypes.AnyXSDType] = value_type
self._value: Optional[ValueDataType] = datatypes.trivial_cast(value, value_type) if value is not None else None
Expand Down
1 change: 0 additions & 1 deletion basyx/aas/model/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class DictObjectStore(AbstractObjectStore[_IT], Generic[_IT]):
:class:`~aas.model.base.Identifier` → :class:`~aas.model.base.Identifiable`
"""
def __init__(self, objects: Iterable[_IT] = ()) -> None:
super().__init__()
self._backend: Dict[Identifier, _IT] = {}
for x in objects:
self.add(x)
Expand Down

0 comments on commit a520467

Please sign in to comment.