"do" as a keyword

Tobiah toby at tobiah.org
Thu Dec 13 14:21:56 EST 2007


> But reading through the warts and reading about a lack of "do while
> statements" I also started to ponder about the "'do something' if
> 'true' else 'do this'", and pondered if perhaps this statement could
> do with the including of the keyword do.

I often miss what can be done in other languages
that support what I call 'side effect' assignment:

while x = get_val_somewhere():
	process(x)

Although, I know that if I write the get function,
I could make it an iterator, and do:

for x in get_val_somewhere():
	process(x)

in which case, I'm even happier.


-- 
Posted via a free Usenet account from http://www.teranews.com




More information about the Python-list mailing list