On Feb 7, 6:34 am, Andreas Waldenburger wrote:
> On Sun, 08 Feb 2009 01:28:00 +1100 Steven D'Aprano
>
> wrote:
> > Andreas Waldenburger wrote:
>
> > > It seems that there is a for...else construct. Replacing the inner
> > > if with pass seems to confirm this. The else clause is still
> > > execut
2009/2/7 andrew cooke :
>
> there's a justification for this awful mess here -
> http://mail.python.org/pipermail/python-3000/2006-March/000104.html
>
> i didn't know about this, and even after reading steven's broken (i
> assume) example, managed to get it backwards.
What's awful about it? Except
there's a justification for this awful mess here -
http://mail.python.org/pipermail/python-3000/2006-March/000104.html
i didn't know about this, and even after reading steven's broken (i
assume) example, managed to get it backwards.
the else is if there *isn't* a break and is for search loops (s
Peter Otten schrieb:
Andreas Waldenburger wrote:
I've found something in the spirit of the following (in the epydoc
sources, if you care):
if True:
print "outer if"
for t in range(2):
if True:
print "for if"
else:
print "phantom else"
For the life of me
Andreas Waldenburger wrote:
On Sun, 08 Feb 2009 01:28:00 +1100 Steven D'Aprano
wrote:
Andreas Waldenburger wrote:
It seems that there is a for...else construct. Replacing the inner
if with pass seems to confirm this. The else clause is still
executed.
Yes, there is a for...else construct.
On Sun, 08 Feb 2009 01:28:00 +1100 Steven D'Aprano
wrote:
> Andreas Waldenburger wrote:
>
> > It seems that there is a for...else construct. Replacing the inner
> > if with pass seems to confirm this. The else clause is still
> > executed.
>
> Yes, there is a for...else construct.
>
That's som
Andreas Waldenburger wrote:
> I've found something in the spirit of the following (in the epydoc
> sources, if you care):
>
> if True:
> print "outer if"
> for t in range(2):
> if True:
> print "for if"
> else:
> print "phantom else"
>
> For the life of me
Andreas Waldenburger wrote:
> It seems that there is a for...else construct. Replacing the inner if
> with pass seems to confirm this. The else clause is still executed.
Yes, there is a for...else construct.
The else block runs if the for loop exits *without* a break.
for i in range(20):
if
On Sat, 7 Feb 2009 15:21:22 +0100 Andreas Waldenburger
wrote:
> outer if
> For if
> For if
> Phantom else
>
Geez, I'm a moron. This is obviously not the output from the snippet.
But if you fix the capitalization, it is. Sorry for that.
/W
--
My real email address is constructed by swapping th
I've found something in the spirit of the following (in the epydoc
sources, if you care):
if True:
print "outer if"
for t in range(2):
if True:
print "for if"
else:
print "phantom else"
For the life of me I can't place the "else". Which if clause does it
be
10 matches
Mail list logo