I surely find them useful, and see them as a Python originality (a
welcome one).
They are indeed an original invention. (One day I looked at the
similarity between if and while and noticed that there was a use case
for else after while too.)
The question remains whether Python would be
Nick Coghlan wrote:
I don't think that's a good idea. What would the following monstrosity
mean?:
if 0:
print Ran the if
else for item in (1, 2, 3):
print item
else try:
print No exception here!
except:
pass
else:
print Who's else is
Ron Adam [EMAIL PROTECTED] writes:
Guido van Rossum wrote:
I even wonder if else-clauses on for/while were a good idea. (The one
on try is definitely a good idea since the use case is quite frequent
and only clumsily handled otherwise; the use cases for else on
for/while are less convincing
[EMAIL PROTECTED] wrote:
... if Py3k ever happens, I'd hope that it would be the *one* Python
to use -- too many incompatibilities would probably mean *two*
Pythons fighting each other).
A caduceus to heal software problems?
http://www.pantheon.org/articles/c/caduceus.html
--Scott David
Michael Hudson wrote:
Ron Adam [EMAIL PROTECTED] writes:
Guido van Rossum wrote:
I even wonder if else-clauses on for/while were a good idea. (The one
on try is definitely a good idea since the use case is quite frequent
and only clumsily handled otherwise; the use cases for else on
Thomas Lotze wrote:
Ron Adam [EMAIL PROTECTED] wrote:
3. In a while loop, it's a value test, where the else block gets
executed if the while condition evaluates as false, the while block
may or may not execute. You still need a flag to test for that.
You're effectively arguing for
Guido van Rossum [EMAIL PROTECTED] wrote:
I also notice that your only example is very repetitive, and would be
better written as a loop, using Python's dynamic nature:
Sure, that's true for the example given. Getting other stuff into a form
which allows for looping may require additional
On 7/7/05, Thomas Lotze [EMAIL PROTECTED] wrote:
Sure, that's true for the example given. Getting other stuff into a form
which allows for looping may require additional code.
Well, hypothetical illustrations don't carry much value when arguing
for something as substantial as new syntax
[Guido van Rossum]
I even wonder if else-clauses on for/while were a good idea.
I surely find them useful, and see them as a Python originality (a
welcome one).
--
François Pinard http://pinard.progiciels-bpi.ca
___
Python-Dev mailing list
Guido van Rossum [EMAIL PROTECTED] wrote:
On 7/7/05, François Pinard [EMAIL PROTECTED] wrote:
[Guido van Rossum]
I even wonder if else-clauses on for/while were a good idea.
I surely find them useful, and see them as a Python originality (a
welcome one).
They are indeed an
[Guido, on {for,while}/else]
...
The question remains whether Python would be easier to learn without
them. And if so, the question would remain whether that's offset by
their utility for experienced developers. All hard to assess
impartially!
That's what I'm here for. I like loop else
[Guido, on {for,while}/else]
...
The question remains whether Python would be easier to learn without
them. And if so, the question would remain whether that's offset by
their utility for experienced developers. All hard to assess
impartially!
[Tim saves the day]
That's what I'm here
Tim Peters [EMAIL PROTECTED] writes:
I also suspect that if they weren't in the language already, a PEP to
introduce them would fail, because
still_looking = True
some loop:
if found it:
still_looking = False
break
if still_looking:
#
At 02:48 PM 7/7/2005 -0400, Tim Peters wrote:
[Guido, on {for,while}/else]
...
The question remains whether Python would be easier to learn without
them. And if so, the question would remain whether that's offset by
their utility for experienced developers. All hard to assess
impartially!
On Thu, Jul 07, 2005, Guido van Rossum wrote:
OTOH I don't particularly like code that requires flag variables; they
often make me squirm because the same condition (flag) is tested
multiple times where it could be tested just once if more
sophisticated flow control (e.g. an else clause :)
[Guido van Rossum]
On 7/7/05, François Pinard [EMAIL PROTECTED] wrote:
[Guido van Rossum]
I even wonder if else-clauses on for/while were a good idea.
I surely find them useful, and see them as a Python originality (a
welcome one).
The question remains whether Python would be easier
[Guido]
OTOH I don't particularly like code that requires flag variables;
Me neither; that's indeed why this one isn't a slam dunk.
they often make me squirm because the same condition (flag) is
tested multiple times where it could be tested just once if more
sophisticated flow control (e.g.
On Thu, 2005-07-07 at 14:54, Guido van Rossum wrote:
How would a PEP to *remove* this feature fare today?
Not well, I hope, although I suppose everything's up for debate in Py3K.
Yes, they're rarely used and there is an alternative, but I do find them
useful and succinct when they're needed.
[Josiah Carlson]
[Guido van Rossum]
I even wonder if else-clauses on for/while were a good idea.
I had gotten along for 5 years without knowing/remembering there existed
an else clause [...]
Just throwing a few more cents in. I have been programming (rather
successfully) for a few
[Jeremy Hylton]
...
PS Every time I switch between Python and C, I get confused about
elif and else if.
Mostly goes to show that you don't use Perl much ;-) Of course, in C99,
#define elif else if
is part of stdlib.h. Or maybe it isn't, and it just should have
been? One of those -- or
On 7/7/05, Tim Peters [EMAIL PROTECTED] wrote:
[Guido]
OTOH I don't particularly like code that requires flag variables;
Me neither; that's indeed why this one isn't a slam dunk.
they often make me squirm because the same condition (flag) is
tested multiple times where it could be
How would a PEP to *remove* this feature fare today?
I hope not well, since I use them quite often.
Barry also reiterated this idea and I support removing them in Python
3000. I do use them when I want to know when I break out of a loop
prematurely, but I am definitely not a typical use
On Thu, Jul 07, 2005 at 03:03:35PM -0400, Phillip J. Eby wrote:
At 02:48 PM 7/7/2005 -0400, Tim Peters wrote:
[Guido, on {for,while}/else]
...
The question remains whether Python would be easier to learn without
them. And if so, the question would remain whether that's offset by
their
On 7/6/05, Thomas Lotze [EMAIL PROTECTED] wrote:
I want to ask what you think about introducing a keyword 'eltry' which
would be the counterpart of 'elif' for try statements. This had been
suggested before on python-list a couple of years ago by Jonathan
Gardner, but nothing (that I could
[Thomas Lotze]
I want to ask what you think about introducing a keyword 'eltry'
which would be the counterpart of 'elif' for try statements. This
had been suggested before on python-list a couple of years ago by
Jonathan Gardner, but nothing (that I could find) seems to have come
of
25 matches
Mail list logo