Making a list-inhereted object return standard repr?

Steve Holden sholden at
Mon Feb 4 16:04:11 CET 2002

"Delaney, Timothy" <tdelaney at> wrote ...
> This brings up the interesting question of whether there should be a an
> object method which returns the "canonical repr" of an object i.e. the
> <module.Class object at address> or possibly even a builtin method (so it
> would work with classic classes too).
> I know I've wanted to use this in classic classes many times for debugging
> purposes - I want to be easily able to distinguish instances from each
> other. Each time I end up having to code it myself.
Although, of course, even this would not necessarily be unambigous if you
had code that produced classes from factory functions, as you would then
have to identify the class by address rather than by name (each class
returned by the factory having either the same name or no name at all,
depending on your point of view).

Consulting, training, speaking:
Python Web Programming:

More information about the Python-list mailing list