No "side effect" assignment!

Sean Ross sross at connectmail.carleton.ca
Mon Sep 15 01:48:08 CEST 2003


"Tobiah" <toby at rcsreg.com> wrote in message
news:0fbc28ebd2ba4810db3efef3a29f990a at news.teranews.com...
> Ok,
>
> I miss the idiom that my other languages use,
> something like:
>
>
> while( foo = getmore()){
> process(foo);
> }
>
[snip]

If you must use assignments in expressions, you might find the following
recipes useful:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/202234
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66061







More information about the Python-list mailing list