[Python-Dev] SyntaxError: can't assign to function call

Josiah Carlson jcarlson at uci.edu
Wed Aug 9 19:13:53 CEST 2006


Neal Becker <ndbecker2 at gmail.com> wrote:
> 
> class X (object):
>     pass
> 
> X() += 2
> 
> > SyntaxError: can't assign to function call
[snip]
> Does anyone else think this would be a good addition to Python?

No.  += implies assignment.  As the syntax error states, "can't assign
to function call".

-1

 - Josiah



More information about the Python-Dev mailing list