I know that methods __repr__
and __str__
exist to give a formal and informal representation of class instances. But does an equivalent exist for class objects too, so that when the class object is printed, a nice representation of it could be shown?
>>> class Foo:
... def __str__(self):
... return "instance of class Foo"
...
>>> foo = Foo()
>>> print foo
instance of class Foo
>>> print Foo
__main__.Foo