Python: while 1
Starting with Py2.3, the interpreter optimizes «while 1» to just a single jump. In contrast «while True» takes several more steps. While the latter is preferred for clarity,
time-critical code should use the first form.
Starting with Py2.3, the interpreter optimizes «while 1» to just a single jump. In contrast «while True» takes several more steps. While the latter is preferred for clarity,
time-critical code should use the first form.
Комментарии 4
while 1 = while true = one step :)
это всё равно константы.
Подробнее: http://stackoverflow.com/questions/3815359 … difference
Но всё равно, спасибо!