Why is "while" ticking me off???

Greg Ewing see at my.signature
Sun Oct 8 21:54:18 EDT 2000


Huaiyu Zhu wrote:
> 
> if a = dict1[k1]; a:
>     a.do_something_interesting()

I don't like that as it stands; it's too hard to read.

It could perhaps be improved:


   if a where a = dict1[k1]:
      a.do_something_interesting()

except that then the evaluation order is different
from the reading order.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list