add Object.__str__()
This commit is contained in:
parent
1a9c65ae1c
commit
03c51eb634
1 changed files with 10 additions and 0 deletions
|
@ -57,6 +57,16 @@ class Object(object):
|
|||
if hasattr(self, key):
|
||||
return getattr(self, key)
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
Leverage :meth:`__unicode__()` method if it exists; otherwise fall back
|
||||
to ``repr(self)``.
|
||||
"""
|
||||
|
||||
if hasattr(self, '__unicode__'):
|
||||
return str(unicode(self))
|
||||
return repr(self)
|
||||
|
||||
|
||||
def basic_logging():
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue