[Python-ideas] Changing str(someclass) to return only the class name
Terry Reedy
tjreedy at udel.edu
Sat Oct 22 06:25:27 CEST 2011
More information about the Python-ideas mailing list
Sat Oct 22 06:25:27 CEST 2011
- Previous message: [Python-ideas] Changing str(someclass) to return only the class name
- Next message: [Python-ideas] Changing str(someclass) to return only the class name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/21/2011 8:39 PM, Nick Coghlan wrote:
> str(module) ==> module.__name__
> str(func) ==> func.__name__
> str(cls) ==> "{}.{}".format(cls.__module__, cls.__name__) # See note below
If you do this, then also do
str(generator) ==> generator.__name__
--
Terry Jan Reedy
- Previous message: [Python-ideas] Changing str(someclass) to return only the class name
- Next message: [Python-ideas] Changing str(someclass) to return only the class name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list