while (a=b()) ...
Mike Steed
steeds at ccms.net
Sun May 2 22:45:10 EDT 1999
Derek T. Jones wrote:
> The solution where the test method and the result method of the object
> in the loop are separate is, I believe, the nicest. But when the object
> you're working with doesn't provide that, then I vote for the "forever"
> loop.
Three cheers for separating the test and the result methods! When the
object you're working with doesn't provide that, my vote is for wrapping
the object with an interface that *does* provide that. Python makes
this especially easy to do. :-)
My $.02.
-Mike
More information about the Python-list
mailing list