chg: Add more typing information

pull/515/head
Raphaël Vinot 2020-01-03 15:42:15 +01:00
parent 0f59cf1ba5
commit aa17663b58
2 changed files with 247 additions and 246 deletions

File diff suppressed because it is too large Load Diff

View File

@ -926,7 +926,7 @@ class MISPEvent(AbstractMISP):
with open(event_path, 'rb') as f:
self.load(f, validate, metadata_only)
def load(self, json_event: Union[IO, str, bytes], validate: bool=False, metadata_only: bool=False):
def load(self, json_event: Union[IO, str, bytes, dict], validate: bool=False, metadata_only: bool=False):
"""Load a JSON dump from a pseudo file or a JSON string"""
if hasattr(json_event, 'read'):
# python2 and python3 compatible to find if we have a file