Curious assignment behaviour

Paul Rubin phr-n2001d at nightsong.com
Tue Oct 9 11:46:51 EDT 2001


"John Roth" <johnroth at ameritech.net> writes:
> However, I think := makes a good choice for an expression assignment
> operator. It needs to be different from both the statement assignment
> operator and the equality operator. It also can't be in use for an
> extended assignment.

Why on earth does it have to be different from the statement assignment
operator?  What's wrong with 

  while x=get_next(): whatever(x)

I just don't buy the rationale that using = instead of == is a big source
of bugs.  In 25 years of hacking C code, I think I've seen that error
maybe once or twice.



More information about the Python-list mailing list