Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Cameron Simpson
On 26Jun2017 13:30, Ethan Furman wrote: On 06/26/2017 01:20 PM, Mikhail V wrote: I dont't like "while True:" simply because it does not make enough visual distinction with the "while condition:" statement. My "while True:" loops look something like: while "": O_o

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Ethan Furman
On 06/26/2017 01:20 PM, Mikhail V wrote: I dont't like "while True:" simply because it does not make enough visual distinction with the "while condition:" statement. My "while True:" loops look something like: while "": -- ~Ethan~ ___

[Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Mikhail V
>All these situations could be handled by making a "while:" with no >condition act as "while True:" >But they could also be handled by updating pep8 to make "while True:" the >recommended infinite loop syntax and make linters smarter about this (if >they aren't already). There was a big related

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Todd
On Jun 26, 2017 2:15 AM, "Chris Angelico" wrote: On Mon, Jun 26, 2017 at 4:08 PM, Terry Reedy wrote: >> If we wanted to allow that to be expressed literally, we could >> probably special case the "while not break" keyword sequence as a do >> loop: >> >>

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Chris Angelico
On Mon, Jun 26, 2017 at 7:22 PM, Greg Ewing wrote: > And just to completely confuse everyone, "while not pass". :-) while "gandalf": ChrisA ___ Python-ideas mailing list Python-ideas@python.org

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Greg Ewing
Chris Angelico wrote: And for completeness, "while not throw:". And just to completely confuse everyone, "while not pass". :-) -- Greg ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Joao S. O. Bueno
and "while not except" :-/ maybe we just stick with "while True' and put forward a documenting PEP advising linter packages to look for ways of getting out of the loop. On 26 June 2017 at 08:08, Terry Reedy wrote: > On 6/26/2017 12:41 AM, Nick Coghlan wrote: > >> On 26 June

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Chris Angelico
On Mon, Jun 26, 2017 at 4:08 PM, Terry Reedy wrote: >> If we wanted to allow that to be expressed literally, we could >> probably special case the "while not break" keyword sequence as a do >> loop: >> >> while not break: >> # Setup >> if condition: break

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Chris Angelico
On Mon, Jun 26, 2017 at 2:41 PM, Nick Coghlan wrote: > If we wanted to allow that to be expressed literally, we could > probably special case the "while not break" keyword sequence as a do > loop: > > while not break: > # Setup > if condition: break >

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-26 Thread Terry Reedy
On 6/26/2017 12:41 AM, Nick Coghlan wrote: On 26 June 2017 at 10:25, Rob Cliffe wrote: On 25/06/2017 12:58, Markus Meskanen wrote: I'm a huge fan of the do...while loop in other languages, and it would often be useful in Python too, when doing stuff like: while

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-25 Thread Nick Coghlan
On 26 June 2017 at 10:25, Rob Cliffe wrote: > > > On 25/06/2017 12:58, Markus Meskanen wrote: >> >> I'm a huge fan of the do...while loop in other languages, and it would >> often be useful in Python too, when doing stuff like: >> >> while True: >> password =

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-25 Thread Rob Cliffe
On 25/06/2017 12:58, Markus Meskanen wrote: I'm a huge fan of the do...while loop in other languages, and it would often be useful in Python too, when doing stuff like: while True: password = input() if password == ...: break [...]I suggest [...] do: password =

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-25 Thread Todd
On Jun 25, 2017 07:58, "Markus Meskanen" wrote: I'm a huge fan of the do...while loop in other languages, and it would often be useful in Python too, when doing stuff like: while True: password = input() if password == ...: break I've seen the pep 315

Re: [Python-ideas] A suggestion for a do...while loop

2017-06-25 Thread Serhiy Storchaka
25.06.17 14:58, Markus Meskanen пише: I'm a huge fan of the do...while loop in other languages, and it would often be useful in Python too, when doing stuff like: while True: password = input() if password == ...: break In this particular case you could write: for

[Python-ideas] A suggestion for a do...while loop

2017-06-25 Thread Markus Meskanen
I'm a huge fan of the do...while loop in other languages, and it would often be useful in Python too, when doing stuff like: while True: password = input() if password == ...: break I've seen the pep 315 which got rejected, and I believe these two suggestions were mostly focused