<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I use "while True"-loops often, and intend to continue doing this<br>
"while True", but I'm curious to know: how widespread is the<br>
injunction against such loops?</blockquote><div><br></div><div>The injunction is nonexistent (save perhaps in people coming from another language who insist that Python just /must/ have a "proper" do-while construct). "while True" with an exit-test at the end is idiomatic, how you spell "do-while" in Python. There's nothing at all wrong with it, and no real Python programmer will ever say don't-do-it.</div>

<div><br></div><div>Okay, some people prefer to spell it 'while 1', but its the same difference.</div><div><br></div><div>Yeah, you have to be certain the exit condition is there and properly formed so it can exit (unless you're using a generator which never empties, of course). But you have to make sure you have a proper exit condition on any looping construct anyways.</div>

<div> </div><div>No idea where your charge came across the advice, but its nonsense.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  Has it reached the status of "best<br>
practice"?<br></blockquote><div><br></div><div>Its simply the correct way to spell a do-while or intentionally infinite loop in Python, always has been.</div><div><br></div><div>HTH,</div><div><br></div><div>--S</div>

</div>