From 10feb5350dff5d2bbbbb056cacc66f825ebfe93e Mon Sep 17 00:00:00 2001 From: Oleg Anashkin Date: Sun, 2 Feb 2014 20:17:59 -0800 Subject: [PATCH] Add __repr__ to Json object for better logging Currently, attempt to log or print Json object uses default python's implementation which is useless. Using actual serialized content is much better. --- lib/_json.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/_json.py b/lib/_json.py index 536dd58b..981fb537 100644 --- a/lib/_json.py +++ b/lib/_json.py @@ -73,6 +73,9 @@ class Json(object): if proto is ISQLQuote: return self + def __repr__(self): + return self.dumps() + def dumps(self, obj): """Serialize *obj* in JSON format.