[New-bugs-announce] [issue2961] Two error messages inconsistent

Chester report at bugs.python.org
Sun May 25 07:56:50 CEST 2008


New submission from Chester <wxpythoner at gmail.com>:

Hello,

I would like to report that two error messages of the Python parser are
not consistent. Please take a look at this:


>>> a = "hello"

>>> a + 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot concatenate 'str' and 'int' objects

>>> 1 + a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'


When the order of the objects is changed, that should only change the
order of the 'str' and 'int' words in the message.

So if a+1, then
TypeError: cannot concatenate 'str' and 'int' objects

and if 1+a, then
TypeError: cannot concatenate 'int' and 'str' objects

----------
messages: 67319
nosy: chester
severity: normal
status: open
title: Two error messages inconsistent
versions: Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2961>
__________________________________


More information about the New-bugs-announce mailing list