From d1dd9d26947eb037f8e5608f03bfe6a6a2df9807 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Mon, 13 Feb 2012 12:10:12 +0100 Subject: Provide string representation for repr() --- source/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/api.py b/source/api.py index 99e636f..3d22d96 100644 --- a/source/api.py +++ b/source/api.py @@ -391,6 +391,9 @@ class Nitrate(object): """ Use object id as the default hash. """ return self.id + def __repr__(self): + return "{0}({1})".format(self.__class__.__name__, self.id) + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Nitrate Methods # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit