22 Aug
2009
22 Aug
'09
8:39 p.m.
On Sun, 23 Aug 2009 05:53:33 am Ron Adam wrote:
An additional note, the when you view an exception object in the console it is bracketed by the less than and and greater than signs. Maybe there is a way to use those in a manner that is consistent with the string repr() returns.
Lots of things have a repr() which includes < and > signs, including repr() itself.
print repr <built-in function repr>
Also new style classes and instances, types, functions, methods, etc. Exceptions are printed with < > signs because exceptions are subclasses of object. There's nothing specifically "exception-like" about the use of < and > in the repr of exceptions. -- Steven D'Aprano