Éric Araujo <mer...@netwok.org> added the comment: > I sometimes wish that the str() of a class would return the class name > rather than its repr(); that way "print(str)" would print "str" > instead of <class 'str'>. (Use case: printing an exception and its > message: I wish I could print("%s: %s" % (err.__class__, err)) instead > of having to use err.__class__.__name__.) Me too. I have a small metaclass to do that :) Given your tentative support, I’ll open a feature request for 3.3.
> One could even claim that the repr() of a class could be the same I think of repr first as “string form for debugging”, so I like the angle brackets. ---------- stage: test needed -> committed/rejected _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue868845> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com