[Python-Dev] Wishlist: dowhile

BJörn Lindqvist bjourne at gmail.com
Mon Jun 13 11:14:24 CEST 2005


> In contrast, the dowhile solution only takes about 30 seconds to get
> used to.  Maybe that idea should follow the path of the genexp PEP, get
> rejected now, and then get resurrected as a bright idea two years from
> now.  Or maybe not.

<nothing about foo here>
dowhile foo != 42:
    <10 lines of body>
    foo = random.randint(1, 50)

Now it becomes annoying because the name is visible long before it is
bound to something. I would like to have do-while's like this:

do:
    <body>
    until <cond>

But I'm sure that has problems too.

-- 
mvh Björn


More information about the Python-Dev mailing list