[Python-3000] Type repr (original) (raw)
Armin Ronacher armin.ronacher at active-4.com
Sun Mar 18 20:45:50 CET 2007
- Previous message: [Python-3000] Fwd: Re: Octal
- Next message: [Python-3000] String literal representation of integers (octal/binary discussion)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hoi,
Some time I proposed changing the type repr to the import name. While I still think this is a good idea ;-) I found a small inconsistency in the repr code of PyTypeObject. Currently the repr checks for the Py_TPFLAGS_HEAPTYPE flag to check if it should use "class" or "type" as name for the repr.
Now where types and classes are the same i don't think it's a good idea to have different reprs for objects defined in python and for objects defined in the C API.
My proposal: change the repr for all objects to "class". So <class 'int'>, <class 'UserDefinedClass'> etc.
Regards, Armin
- Previous message: [Python-3000] Fwd: Re: Octal
- Next message: [Python-3000] String literal representation of integers (octal/binary discussion)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]