core, CLI (base), tools (common/data_format): typing/core readability
This commit is contained in:
parent
84e6d9ceb2
commit
a74f9327f2
1 changed files with 37 additions and 29 deletions
|
|
@ -20,6 +20,8 @@
|
|||
""" tools common to backend and frontends """
|
||||
# FIXME: json may be more appropriate than manual serialising like done here
|
||||
|
||||
from typing import Any
|
||||
|
||||
from sat.core import exceptions
|
||||
import json
|
||||
|
||||
|
|
@ -133,7 +135,7 @@ def serialise(data):
|
|||
"""
|
||||
return json.dumps(data, ensure_ascii=False, default=str)
|
||||
|
||||
def deserialise(serialised_data, default=None, type_check=dict):
|
||||
def deserialise(serialised_data: str, default: Any = None, type_check: type = dict):
|
||||
"""Deserialize data from bridge
|
||||
|
||||
@param serialised_data(unicode): data to deserialise
|
||||
|
|
|
|||
Loading…
Reference in a new issue