[Python-Dev] For/while/if statements/comprehension/generator expressions unification

2005-09-19 Thread Alexander Myodov
Hello, Well, we have "for", "while" and "if". We also have statements, list generator expressions and list comprehensions. In comprehensions we have the opportunity to use several for-s and in a same expression (for i in range (0, 640) for j in range (0, 640)), in loops we cannot; in com

Re: [Python-Dev] For/while/if statements/comprehension/generator expressions unification

2005-09-19 Thread Alexander Myodov
Hello Josiah, JC> Alexander, JC> The essence of what you have proposed has been proposed (multiple times) before, JC> and I seem to remember it was shot down. To increase my understanding of Python-way, can you (or someone else) explain the reasons why such proposals were rejected? JC> The belo

[Python-Dev] Visibility scope for "for/while/if" statements

2005-09-22 Thread Alexander Myodov
Hello, Don't want to be importunate annoyingly asking the things probably trivial for experienced community, but need to ask it anyway, after spending about two hours trying to find well-camouflaged error caused by it. Why the variables defined inside "for"/"while"/"if" statements (includi

Re: [Python-Dev] Visibility scope for "for/while/if" statements

2005-09-22 Thread Alexander Myodov
Hello Josiah, >> Why the variables defined inside "for"/"while"/"if" statements >> (including loop variables for "for") are visible outside this scope? JC> if and while statements don't define variables, so they can't expose JC> them later in the scope. They don't. They just leak internal ones:

Re: [Python-Dev] Visibility scope for "for/while/if" statements

2005-09-22 Thread Alexander Myodov
Hello Josiah, >> i = 0 >> while i != 1: >> i += 1 >> j = 5 >> print j JC> Maybe you don't realize this, but C's while also 'leaks' internal JC> variables... JC> int i = 0, j; JC> while (i != 1) { JC> i++; JC> j = 5; JC> } JC> printf("%i %i\n", i, j); Yeah, it may *leak* it in your