[issue23275] Can assign [] = (), but not () = []

Martin Panter report at bugs.python.org
Tue Jan 20 10:40:47 CET 2015


Martin Panter added the comment:

But () is the odd one out if you consider

>>> [a, b] = range(2)
>>> [] = range(0)
>>> (a, b) = range(2)
>>> () = range(0)
  File "<stdin>", line 1
SyntaxError: can't assign to ()

----------
nosy: +vadmium

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


More information about the Python-bugs-list mailing list