summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Šplíchal <psplicha@redhat.com>2012-02-13 12:10:12 +0100
committerPetr Šplíchal <psplicha@redhat.com>2012-02-29 11:26:28 +0100
commitd1dd9d26947eb037f8e5608f03bfe6a6a2df9807 (patch)
tree6bcf69788c56b2debdfc31189fb0f20c5088a3e8
parent2000d28b07aac78bbad238938aacfde64ff3802e (diff)
downloadpython-nitrate-d1dd9d26947eb037f8e5608f03bfe6a6a2df9807.tar.gz
python-nitrate-d1dd9d26947eb037f8e5608f03bfe6a6a2df9807.tar.xz
python-nitrate-d1dd9d26947eb037f8e5608f03bfe6a6a2df9807.zip
Provide string representation for repr()
-rw-r--r--source/api.py3
1 files changed, 3 insertions, 0 deletions
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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~