From: Hector Martin Date: Thu, 3 Dec 2015 11:51:35 +0000 (+0900) Subject: pybind/rbd.pyx: Return something useful from str() and repr() X-Git-Tag: v10.0.2~70^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e15c039976462944399aa1bcd8d8819b3351960;p=ceph.git pybind/rbd.pyx: Return something useful from str() and repr() str() defaults to repr(), so implement __repr__ instead. Signed-off-by: Hector Martin --- diff --git a/src/pybind/rbd.pyx b/src/pybind/rbd.pyx index 14f33014c0cf..c1a1df45ace1 100644 --- a/src/pybind/rbd.pyx +++ b/src/pybind/rbd.pyx @@ -654,9 +654,8 @@ cdef class Image(object): def __del__(self): self.close() - def __str__(self): - s = "rbd.Image(" + dict.__repr__(self.__dict__) + ")" - return s + def __repr__(self): + return "rbd.Image(ioctx, %r)" % self.name def resize(self, size): """