Curious assignment behaviour
Dale Strickland-Clark
dale at riverhall.NOSPAMco.uk
Mon Oct 8 09:58:54 EDT 2001
Thanks everyone.
"assignment_stmt: (target_list "=")+ expression_list"
That little '+' escaped me.
I accept the confusion that the examples make possible:
if(x=0)
are not desirable.
So how about an alternative assignment operator that can't be confused
with equality but which yeilds the assigned value?
Pascal uses :=
Another language (I forget which) uses <-
(I've always prefered := for assignment and a plain = for equality.)
I don't suppose I'm the first to suggest this, either.
--
Dale Strickland-Clark
Riverhall Systems Ltd
More information about the Python-list
mailing list