Terry J. Reedy added the comment:

The issue History suggests that the original report was marked for 2.6, 3.0, 
3.1.  It is not clear which versions the OP or anyone else tested.  I removed 
the versions above and added 3.2, 3.3 after reporting a test on 3.2.0.  I did 
not report 2.7 behavior and don't know when 2.7 was added.

In any case, 2.7.13 has the same % behavior as 3.6 (and 3.7):

>>> '' % 1
...
TypeError: not all arguments converted during string formatting

So someone or ones decided to resolve the inconsistency in a manner the 
opposite of what Martin suggested.

''.format(1, 2, 3) *does* ignore the extra arguments, but I will not call the 
difference between % and .format a bug, as it appears intentional.  With f 
strings, there is no issue of 'extra arguments

I augmented the title to be clearer that the issue was the inconsistency, which 
is now gone.  Thanks, Cheryl, for rechecking.

----------
components: +Interpreter Core
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
title: '' % object() raises TypeError -> '' % object() raises TypeError, '' % 
A() does not

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6396>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to