From 0b6991b77fea008163d08ccc1777ac405e2b0a41 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 23 Dec 2021 17:42:57 +0100 Subject: Add type annotations to player.py and status.py Signed-off-by: Olivier Gayot --- swiftstory/status.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'swiftstory/status.py') diff --git a/swiftstory/status.py b/swiftstory/status.py index fb8347b..d794580 100644 --- a/swiftstory/status.py +++ b/swiftstory/status.py @@ -1,8 +1,9 @@ +from typing import Any import json -def error(msg, code=255): +def error(msg: str, code: int = 255) -> str: return json.dumps({'type': 'response', 'content': {'status': code, 'info': msg}}) -def success(obj): +def success(obj: Any) -> str: return json.dumps({'type': 'response', 'content': {'status': 0, 'result': obj}}) -- cgit v1.2.3