[Python-ideas] Changing str(someclass) to return only the class name

Éric Araujo merwok at netwok.org
Sun Oct 23 04:47:18 CEST 2011

Le 23/10/2011 04:33, Guido van Rossum a écrit :
> (And I have to agree with Nick that it's best to just return __name__
> in all three cases, rather than trying to be clever and use the
> qualified name.)

My first reaction was that returning 'module.name' was more helpful and
saved more typing than just 'name', but I don’t have any real arguments.

I will update the patch on http://bugs.python.org/issue13224 to change
the repr of functions and modules.  People concerned about breakage will
be able to compile a patched Python to test their code.


More information about the Python-ideas mailing list