A Summary: Expression-Assignments. (Very Long)

Adrian Eyre a.eyre at optichrome.com
Wed May 12 09:03:42 EDT 1999


> Unlike C and Perl, in Python the code 'a=b' is a statement, not an
> expression. That means it does not return any value, [snip]

Actually, I find this part of Python a bit inconsistent since:

a=b=1		is valid while
a=(b=1)	is not...

To me the fact that 'a=b=1' works implies that the 'b=1' bit is
actually returning a value. This should perhaps be more consistent
in Python by either making 'a=b=1' illegal, or making 'a=(b=1)' legal.

--------------------------------------------
Adrian Eyre <mailto:a.eyre at optichrome.com>
Optichrome Computer Solutions Ltd
Maybury Road, Woking, Surrey, GU21 5HX, UK
Tel: +44 1483 740 233  Fax: +44 1483 760 644
http://www.optichrome.com 
--------------------------------------------





More information about the Python-list mailing list