Message221993
| Author |
josh.r |
| Recipients |
Claudiu.Popa, benjamin.peterson, hynek, josh.r, pitrou, serhiy.storchaka, stutzbach |
| Date |
2014年06月30日.23:31:01 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1404171061.47.0.312057415339.issue21861@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Is it common for C implementations to introspect to figure out their "real" name? I do this manually for reprs of my user defined classes, but I haven't noticed many built-ins that consider extensibility for the repr. Maybe I'm just not using the classes that do it or I'm overriding the repr without checking?
I just tested, and it looks like frozenset has a subclass friendly repr, while bytearray does not as of 3.4.0. Seems like it might make sense to first determine if introspection should be the default; it would mean a little code bloat every time it's done. |
|