This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年05月01日 17:15 by jentyk, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg242336 - (view) | Author: (jentyk) | Date: 2015年05月01日 17:15 | |
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... |
|||
| msg242338 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2015年05月01日 17:26 | |
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.) |
|||
| msg242343 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2015年05月01日 17:55 | |
I think David meant the "else" clause on a "for" statement: https://docs.python.org/2/reference/compound_stmts.html#the-for-statement |
|||
| msg242371 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2015年05月02日 02:21 | |
Oops. Yes, that's what I meant :) Thanks for the correction and link, Eric. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:16 | admin | set | github: 68294 |
| 2015年05月02日 02:21:37 | r.david.murray | set | messages: + msg242371 |
| 2015年05月01日 17:55:49 | eric.smith | set | nosy:
+ eric.smith messages: + msg242343 |
| 2015年05月01日 17:26:27 | r.david.murray | set | status: open -> closed nosy: + r.david.murray messages: + msg242338 resolution: not a bug stage: resolved |
| 2015年05月01日 17:15:47 | jentyk | create | |