A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-June/054180.html below:

[Python-Dev] Wishlist: dowhile

[Python-Dev] Wishlist: dowhile [Python-Dev] Wishlist: dowhileDmitry Dvoinikov dmitry at targeted.org
Mon Jun 13 12:43:36 CEST 2005
>> do:
>>     <body>
>>     until <cond>

> That looks nice to me.

Except this puts loop entry statement (do) and loop condition
test (until) on different levels of indentation, which is
I don't quite like.

Compared to the existing loop statements,

-------------------
while Cond:
    body
else:
    exit
-------------------
for Iter:
    body
else:
    exit
-------------------

This would seem more logical:

-------------------
do:
    body
while Cond:
else:
    exit
-------------------
do:
    body
until Cond:
else:
    exit
-------------------

Although the trailing colon is still a bit unpleasant:

-------------------

do:
    body
while Cond:

# no else here

-------------------

Sincerely,
Dmitry Dvoinikov
http://www.targeted.org/

--- Original message follows ---

> [BJörn Lindqvist] 
>> I would like to have do-while's like this:
>> 
>> do:
>>     <body>
>>     until <cond>
>> 
>> But I'm sure that has problems too.

> That looks nice to me.



> Raymond
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/dmitry%40targeted.org

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4