diff sat/tools/common/data_format.py @ 3893:045af0eeda3f

core, CLI (base), tools (common/data_format): typing/core readability
author Goffi <goffi@goffi.org>
date Wed, 21 Sep 2022 22:20:43 +0200
parents be6d91572633
children 524856bd7b19
line wrap: on
line diff
--- a/sat/tools/common/data_format.py	Wed Aug 31 17:07:03 2022 +0200
+++ b/sat/tools/common/data_format.py	Wed Sep 21 22:20:43 2022 +0200
@@ -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 @@
     """
     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