summaryrefslogtreecommitdiff
path: root/json_serializable.py
diff options
context:
space:
mode:
authorromangraef <roman.graef@gmail.com>2018-06-01 11:07:02 +0200
committerromangraef <roman.graef@gmail.com>2018-06-01 11:07:23 +0200
commita4717724853ce92888c8aa6c082a25428e00720b (patch)
tree3697459def6ec3e330bac2b5321908bd372c2daa /json_serializable.py
parent22480d21a0d647d7f1d86a5efb25368225fcb7dd (diff)
downloadmy-website-a4717724853ce92888c8aa6c082a25428e00720b.tar.gz
my-website-a4717724853ce92888c8aa6c082a25428e00720b.tar.bz2
my-website-a4717724853ce92888c8aa6c082a25428e00720b.zip
added editing abilities
Diffstat (limited to 'json_serializable.py')
-rw-r--r--json_serializable.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/json_serializable.py b/json_serializable.py
index 87db9d1..eedade6 100644
--- a/json_serializable.py
+++ b/json_serializable.py
@@ -1,7 +1,7 @@
import json
from datetime import datetime
from enum import Enum
-from typing import Dict, Type, List
+from typing import Dict, Type, List, Union
def from_json(data, cls: Type):
@@ -49,7 +49,7 @@ def prepare_json(obj):
class JsonSerializable(object):
@classmethod
- def load(cls, data):
+ def load(cls, data: Union[str, dict]):
if isinstance(data, str):
data = json.loads(data)
return from_json(data, cls)