[Python-ideas] SyntaxWarning for for/while/else without break or return?
Stephen J. Turnbull
stephen at xemacs.org
Sun Oct 11 17:33:23 CEST 2009
Steven D'Aprano writes:
> You're kidding, right?
> Or is anything but acquiescence to the idea of giving a warning
That's not the alternative to "kidding".
> Just because somebody proposes a change, doesn't mean that
> opposition to that change is off-topic.
"There you go again." I have no problem with opposition, and if you
go back and read my posts, that's clear. It's the bogus attribution
of motives and wildly exaggerated claims that need to stop, on both
sides. On your side, the "proliferation of warnings" and the "warn on
anything that might trip up a naive programmer who hasn't read the
docs" nonsense. Neither is in question.
There's *one* warning in question, the construct is legal and
unambiguous as implemented. Good luck contesting those facts. So the
topic is "how useful and common is the construct, correctly used?"
vs. "how much code in actual use is likely to be written under the
seductive spell of the meaning of 'else' in English?" (I'm open to
other suggestions, within the framework of "only one warning" and
"construct is unambiguous when understood.")
At the moment, my assessment is "almost useless" and "it is likely
that a large majority of the code using 'breakless for-else' is
written with the wrong semantics expected, and a substantial fraction
of those will actually result in buggy behavior." On that basis, I'm
about +0.5 on issuing a warning. I don't know if my opinion matters
to anybody but me but it *is* up for grabs; my current stance is not
set in concrete.
I can tell you that the *style* of your last five posts or so have
tended to tilt my opinion against you, while Nick and Georg (except
that last ad hominem, of course) have been steadily scoring a point or
two per post on content.
More information about the Python-ideas