diff --git a/swh/model/from_disk.py b/swh/model/from_disk.py index bd6308ec74482a482452aea388a65053c84a0573..48d701612424083b2d70db9125d9dca723068152 100644 --- a/swh/model/from_disk.py +++ b/swh/model/from_disk.py @@ -138,7 +138,7 @@ class Content(MerkleLeaf): """ - __slots__ = [] # type: List[str] + __slots__: List[str] = [] object_type: Final = "content" @classmethod diff --git a/swh/model/hashutil.py b/swh/model/hashutil.py index 8d2cb908e35f9bb7fc85e316b40f8750c0f562d4..e686547b1ce24300e59e3f52a70cc4542f6e8a4e 100644 --- a/swh/model/hashutil.py +++ b/swh/model/hashutil.py @@ -72,7 +72,7 @@ Subset of :const:`ALGORITHMS`. HASH_BLOCK_SIZE = 32768 """Block size for streaming hash computations made in this module""" -_blake2_hash_cache = {} # type: Dict[str, Callable] +_blake2_hash_cache: Dict[str, Callable] = {} class MultiHash: diff --git a/swh/model/merkle.py b/swh/model/merkle.py index b224840782e38d09a9ccad1786b6e99a4b6cf630..33814be6b2c32cc9602d27356bfefc3760898a00 100644 --- a/swh/model/merkle.py +++ b/swh/model/merkle.py @@ -217,7 +217,7 @@ class MerkleLeaf(MerkleNode): A Merkle leaf is simply a Merkle node with children disabled. """ - __slots__ = [] # type: List[str] + __slots__: List[str] = [] def __setitem__(self, name, child): raise ValueError("%s is a leaf" % self.__class__.__name__) diff --git a/swh/model/tests/test_from_disk.py b/swh/model/tests/test_from_disk.py index 3ab7ba242b836c16934175d3bbd58555721b6755..946fd533428a2d428794e1d99749de1c330e744c 100644 --- a/swh/model/tests/test_from_disk.py +++ b/swh/model/tests/test_from_disk.py @@ -136,7 +136,7 @@ class TestDiskBackedContent(unittest.TestCase): class DataMixin: - maxDiff = None # type: ClassVar[Optional[int]] + maxDiff: ClassVar[Optional[int]] = None def setUp(self): self.tmpdir = tempfile.TemporaryDirectory(prefix="swh.model.from_disk")