[Python-checkins] r63965 - python/trunk/Lib/tokenize.py

Raymond Hettinger python at rcn.com
Fri Jun 6 00:52:05 CEST 2008


These were intentionly left as "while 1" in Py2.6 because it compiles differently than "while True" and is much slower.
In Py3.0, the True can be optimized away.

Raymond


> Log:
> use the more idomatic while True
> 
> 
> Modified:
>   python/trunk/Lib/tokenize.py
> 
> Modified: python/trunk/Lib/tokenize.py
> ==============================================================================
> --- python/trunk/Lib/tokenize.py (original)
> +++ python/trunk/Lib/tokenize.py Fri Jun  6 00:39:34 2008
> @@ -281,7 +281,7 @@
>     contline = None
>     indents = [0]
> 
> -    while 1:                                   # loop over lines in stream
> +    while True:                       # loop over lines in stream
>         try:
>             line = readline()
>         except StopIteration:
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins


More information about the Python-checkins mailing list