No "side effect" assignment!

Dave Kuhlman dkuhlman at rexx.com
Sun Sep 14 18:04:42 EDT 2003


Tobiah wrote:

[snip]
> 
> 
> I can't seem to do this in python without gagging:
> 
> foo = getmore()
> while foo:
> process(foo)
> foo = getmore()

Then test your gag reflex on the following:

while 1:
    foo = getmore()
    if not foo:
        break
    process(foo)

Slips down pretty smoothly with me.

[snip]

Dave

-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman
dkuhlman at rexx.com




More information about the Python-list mailing list