From c09b9fc0fd45c4873d24b987949f93a4969ddb93 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 11 Oct 2016 17:29:22 +0200 Subject: [PATCH] Make util.py comply to 79 chars --- util.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/util.py b/util.py index 4e7a9818..f6f671db 100644 --- a/util.py +++ b/util.py @@ -16,11 +16,12 @@ def gen_timestamp(): def serialize(data): """Serialize a dict into a JSON formatted string. - This function enforces rules like the separator and order of keys. This ensures that all dicts - are serialized in the same way. + This function enforces rules like the separator and order of keys. + This ensures that all dicts are serialized in the same way. - This is specially important for hashing data. We need to make sure that everyone serializes their data - in the same way so that we do not have hash mismatches for the same structure due to serialization + This is specially important for hashing data. We need to make sure that + everyone serializes their data in the same way so that we do not have + hash mismatches for the same structure due to serialization differences. Args: @@ -30,7 +31,8 @@ def serialize(data): str: JSON formatted string """ - return rapidjson.dumps(data, skipkeys=False, ensure_ascii=False, sort_keys=True) + return rapidjson.dumps(data, skipkeys=False, ensure_ascii=False, + sort_keys=True) def deserialize(data): @@ -40,6 +42,7 @@ def deserialize(data): data (str): JSON formatted string. Returns: - dict: dict resulting from the serialization of a JSON formatted string. + dict: dict resulting from the serialization of a JSON formatted + string. """ return rapidjson.loads(data)