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
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
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
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:
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