[Python-3000] Announcing PEP 3136

Matt Chisholm matt-python at theory.org
Tue Jul 10 03:33:07 CEST 2007


On Jul  3 2007, 10:14, Guido van Rossum wrote:
>On 6/30/07, Matt Chisholm <matt-python at theory.org> wrote:
>>I've created and submitted a new PEP proposing support for labels in
>>Python's break and continue statements.  Georg Brandl has graciously
>>added it to the PEP list as PEP 3136:
>>
>>http://www.python.org/dev/peps/pep-3136/
>
>I think this is a good summary of various proposals that have been
>floated in the past, plus some new ones. As a PEP, it falls short
>because it doesn't pick a solution but merely offers a large menu of
>possible options. Also, there is nothing about implementation yet.

I was hoping the community would pick their favorite option.  And I
planned to address implementation if the PEP was well received.

>However, I'm rejecting it on the basis that code so complicated to
>require this feature is very rare. In most cases there are existing
>work-arounds that produce clean code, for example using 'return'.
>While I'm sure there are some (rare) real cases where clarity of the
>code would suffer from a refactoring that makes it possible to use
>return, this is offset by two issues:
>
>1. The complexity added to the language, permanently. This affects not
>only all Python implementations, but also every source analysis tool,
>plus of course all documentation for the language.

Not knowing anything about the implementation details, I can't argue
with that.

>2. My expectation that the feature will be abused more than it will be
>used right, leading to a net decrease in code clarity (measured across
>all Python code written henceforth). Lazy programmers are everywhere,
>and before you know it you have an incredible mess on your hands of
>unintelligible code.

Are break / continue currently abused more than they are used right,
or used to make code difficult to understand?  I am trying to come up
with an example of mis-use of labeled break or continue that is
mitigated by the absence of labels, and I can't quite think of one.
Maybe I'm being unimaginative. :)

>I realize this is a heavy bar to pass, and somewhat subjective. That's
>okay. There is real value in having a small language. Also, as I said,
>while there are no past PEPs to document it, this has been brought up
>and rejected many times before.

So, I don't quite agree, but you're the boss.  If this has been
rejected before, I don't want to waste everybody's time discussing it
again.  Should I add your justification to the PEP and change it's
status?

-matt

P.S. Thanks to everybody who read the PEP and commented. :)



More information about the Python-3000 mailing list