Hmm... An idea: if a,b==c,d:

Richard Dillingham shadowlord13_1 at yahoo.com
Mon Nov 18 17:59:04 EST 2002


It doesn't have ()s, so it ain't two tuples. Easy enough, da?

"Carl Banks" <imbosol at vt.edu> wrote in message
news:arbqp2$rkb$1 at solaris.cc.vt.edu...
> Richard Dillingham wrote:
> > Kind of like we have multiple assignments in a line (oldx,oldy=x,y),
what do
> > you think of the ability to have multiple tests in an if statement with
only
> > one == or >=.
> >
> > This would mean that lines like the following:
> > if posx>=coords[0] and posy>=coords[1] and posx<=coords[2] and
> > posy<=coords[3]:
> >
> > Could be rewritten like so:
> > if posx,posy>=coords[0],coords[1] and posx,posy<=coords[2],coords[3]
>
> How would you disambiguate that from a comparison of two tuples?
>
>
> --
> CARL BANKS





More information about the Python-list mailing list