[Python-ideas] Is this PEP-able? for X in ListY while conditionZ:

Robert Kern robert.kern at gmail.com
Wed Jun 26 12:57:30 CEST 2013


On 2013-06-26 00:05, Andrew Barnert wrote:
> From: "jimjhb at aol.com" <jimjhb at aol.com>
> Sent: Tuesday, June 25, 2013 11:11 AM
>
>
>> Maybe something from the Python leadership saying breaks are fine?  Given their lack of
>> support for gotos it's easy to see how others might feel breaks and continues are bad as well,
>> even in Python.
>
> $ grep break cpython/Lib/*py |wc -l
> 551
>
> $ grep continue cpython/Lib/*py |wc -l
> 280

These numbers should be a bit more accurate by recursing into packages (and 
tests, which one may not want, but I'd count them) and only counting actual uses 
of the keywords in code:

[cpython/Lib]$ grinpython.py --without-filename -p '\bbreak\b' | wc -l
      740

[cpython/Lib]$ grinpython.py --without-filename -p '\bcontinue\b' | wc -l
      607

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco



More information about the Python-ideas mailing list