[Python-3000] Adding __format__ to object

Eric Smith eric+python-dev at trueblade.com
Thu Aug 16 14:08:14 CEST 2007


As part of implementing PEP 3101, I need to add __format__ to object, to 
achieve the equivalent of:

class object:
     def __format__(self, format_spec):
         return format(str(self), format_spec)

I've added __format__ to int, unicode, etc., but I can't figure out 
where or how to add it to object.

Any pointers are appreciated.  Something as simple as "look at foo.c" or 
"grep for __baz__" would be good enough.

Thanks!
Eric.


More information about the Python-3000 mailing list