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

Carl Banks imbosol at vt.edu
Mon Nov 18 17:17:50 EST 2002


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