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.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com