diff options
| author | mmstanone | 2021-11-11 11:52:19 +0100 |
|---|---|---|
| committer | mmstanone | 2021-11-11 11:52:19 +0100 |
| commit | 2eed76ddc3f19e089bc9a6cee8ceb53ff1714d29 (patch) | |
| tree | 2df8a8f1c60dce47ae4b7b69fdf2a98d66de2df1 | |
| parent | 929f13439503ca6502ee923b2a560752b174b9bb (diff) | |
| download | sec-certs-2eed76ddc3f19e089bc9a6cee8ceb53ff1714d29.tar.gz sec-certs-2eed76ddc3f19e089bc9a6cee8ceb53ff1714d29.tar.zst sec-certs-2eed76ddc3f19e089bc9a6cee8ceb53ff1714d29.zip | |
LSP + paths
| -rw-r--r-- | sec_certs/certificate/certificate.py | 4 | ||||
| -rw-r--r-- | sec_certs/certificate/protection_profile.py | 2 | ||||
| -rw-r--r-- | sec_certs/dataset/dataset.py | 4 | ||||
| -rw-r--r-- | sec_certs/dataset/protection_profile.py | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/sec_certs/certificate/certificate.py b/sec_certs/certificate/certificate.py index ddcd2cb7..e6276621 100644 --- a/sec_certs/certificate/certificate.py +++ b/sec_certs/certificate/certificate.py @@ -34,7 +34,9 @@ class Certificate(ABC, ComplexSerializableType): def label_studio_title(self): raise NotImplementedError('Not meant to be implemented') - def __eq__(self, other: 'Certificate') -> bool: + def __eq__(self, other: object) -> bool: + if not isinstance(other, Certificate): + return NotImplemented return self.dgst == other.dgst def to_dict(self): diff --git a/sec_certs/certificate/protection_profile.py b/sec_certs/certificate/protection_profile.py index 1bca2c31..976c7666 100644 --- a/sec_certs/certificate/protection_profile.py +++ b/sec_certs/certificate/protection_profile.py @@ -15,7 +15,7 @@ class ProtectionProfile(ComplexSerializableType): """ Object for holding protection profiles. """ - pp_name: str + pp_name: Optional[str] pp_link: Optional[str] = None pp_ids: Optional[FrozenSet[str]] = None diff --git a/sec_certs/dataset/dataset.py b/sec_certs/dataset/dataset.py index 0842122d..c4673373 100644 --- a/sec_certs/dataset/dataset.py +++ b/sec_certs/dataset/dataset.py @@ -74,7 +74,9 @@ class Dataset(ABC): def __len__(self) -> int: return len(self.certs) - def __eq__(self, other: 'Dataset') -> bool: + def __eq__(self, other: object) -> bool: + if not isinstance(other, Dataset): + return NotImplemented return self.certs == other.certs def __str__(self) -> str: diff --git a/sec_certs/dataset/protection_profile.py b/sec_certs/dataset/protection_profile.py index 51617b1c..99420dc6 100644 --- a/sec_certs/dataset/protection_profile.py +++ b/sec_certs/dataset/protection_profile.py @@ -47,7 +47,7 @@ class ProtectionProfileDataset: return cls(dct) @classmethod - def from_web(cls, store_dataset_path: Optional[Union[str, Path]]): + def from_web(cls, store_dataset_path: Optional[Path]): logger.info(f'Downloading static PP dataset from: {cls.static_dataset_url}') if not store_dataset_path: tmp = tempfile.TemporaryDirectory() |
