[New-bugs-announce] [issue12318] list + tuple inconsistency

Filip Gruszczyński report at bugs.python.org
Sun Jun 12 00:02:51 CEST 2011


New submission from Filip Gruszczyński <gruszczy at gmail.com>:

You can do this:
>>> [1] + (1,)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "tuple") to list

But you can do this:

>>> result = [1]
>>> result += (1,)
>>> result
[1, 1]


Is it the expected behaviour, that += does implicit coercion?

----------
messages: 138185
nosy: gruszczy
priority: normal
severity: normal
status: open
title: list + tuple inconsistency
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12318>
_______________________________________


More information about the New-bugs-announce mailing list