Skip to content

Commit

Permalink
Better type hints for json
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinolog committed Nov 22, 2019
1 parent f2a53d1 commit 69fa286
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions exec_helpers/exec_result.py
Expand Up @@ -533,14 +533,16 @@ def __deserialize(self, fmt: str) -> typing.Any:
raise NotImplementedError(msg)

@property
def stdout_json(self) -> typing.Any:
def stdout_json(
self,
) -> typing.Union[typing.Dict[str, typing.Any], typing.List[typing.Any], str, int, float, bool, None]:
"""JSON from stdout.
:rtype: typing.Any
:raises DeserializeValueError: STDOUT can not be deserialized as JSON
"""
with self.stdout_lock:
return self.__deserialize(fmt="json")
return self.__deserialize(fmt="json") # type:ignore

@property
def stdout_yaml(self) -> typing.Any:
Expand Down

0 comments on commit 69fa286

Please sign in to comment.