[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread R. David Murray

R. David Murray added the comment:

Oops.  Yes, that's what I meant :)  Thanks for the correction and link, Eric.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread Eric V. Smith

Eric V. Smith added the comment:

I think David meant the "else" clause on a "for" statement:

https://docs.python.org/2/reference/compound_stmts.html#the-for-statement

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread R. David Murray

R. David Murray added the comment:

Whitespace is significant in Python.  This is a fundamental part of the 
language.  So yes, this is intentional.  (Look up what the 'else' clause means 
on an if statement in the language reference.)

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread jentyk

New submission from jentyk:

In [14]: for i in xrange(10):
   : if 1==1:
   : print "It's true"
   : else:
   : print "It isn't true. Seriously??"
   :
It's true
It's true
It's true
It's true
It's true
It's true
It's true
It's true
It's true
It's true
It isn't true. Seriously??

Is the behaviour intentional? I do not think so...

--
components: Interpreter Core
messages: 242336
nosy: jentyk
priority: normal
severity: normal
status: open
title: Messed up indentation makes undesired piece of code being run!
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com