Marc Tompkins <marc.tompk...@gmail.com> writes:

> And I apologize for imputing motive (a liking for "while True"); I'd
> just noticed that you often advise it. I don't know who _does_ think
> this is a desirable pattern; I'd love to hear their argument for it -
> it must be really good.

It works better than alternatives already available in the language; it
is simpler than alternatives already available in the language. It isn't
particularly ugly (nor is it particularly beautiful, I'll grant you).

And it works well enough, and is simple enough, to be recommended
without caveat to anyone needing a loop to end somewhere other than the
top.

Any alternative structure would need to be *significantly* better than
what already works now. That, in the end, is the strongest argument for
‘while True: … break’.

-- 
 \          “When [science] permits us to see the far side of some new |
  `\      horizon, we remember those who prepared the way – seeing for |
_o__)                          them also.” —Carl Sagan, _Cosmos_, 1980 |
Ben Finney

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to