23 Feb
2010
23 Feb
'10
6:36 p.m.
The root cause of this problem is object.__format__, which is basically:
def __format__(self, fmt): return str(self).__format__(fmt)
So here we're changing the type of the object (to str) but still keeping the same format string. That doesn't make any sense: the format string is type specific. I think the correct thing to do here is to make it an error if fmt is non-empty. In 2.7 and 3.2 I can make this a PendingDeprecationWarning, then in 3.3 a DeprecationWarning, and finally make it an error in 3.4.
I have this implemented in issue 7994 with a PendingDeprecationWarning. Unless someone objects I'm going to document it and apply the patch. Eric.