Message145839
| Author | eric.araujo |
|---|---|
| Recipients | belopolsky, eric.araujo, georg.brandl, gvanrossum, ncoghlan, petri.lehtinen, terry.reedy |
| Date | 2011-10-18.16:40:39 |
| SpamBayes Score | 0.00039415897 |
| Marked as misclassified | No |
| Message-id | <1318956040.48.0.616870464826.issue868845@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
> 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. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2011-10-18 16:40:40 | eric.araujo | set | recipients: + eric.araujo, gvanrossum, georg.brandl, terry.reedy, ncoghlan, belopolsky, petri.lehtinen |
| 2011-10-18 16:40:40 | eric.araujo | set | messageid: <1318956040.48.0.616870464826.issue868845@psf.upfronthosting.co.za> |
| 2011-10-18 16:40:39 | eric.araujo | link | issue868845 messages |
| 2011-10-18 16:40:39 | eric.araujo | create | |