The rap against "while True:" loops

Paul Rubin http
Wed Oct 14 19:30:17 EDT 2009


Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:
> Why should Python make that guarantee about this hypothetical "loop 
> forever" construct?

It doesn't make much sense for Python as normally practiced.
Termination proofs (aka proofs of progress) are used in formal
verification systems to make sure that the verification logic is
consistent and that type-level inferences are valid.  They generally
have very little to do with making sure that the program's actual
running time is bounded by anything reasonable.  In fact infinite
loops are permitted in some such systems, but only on infinite data
streams (e.g. the request stream of a web server).

  http://en.wikipedia.org/wiki/Total_functional_programming 

cites a pretty accessible paper by D. Turner that explains the
idea in more detail.



More information about the Python-list mailing list