Re: [Python-ideas] For-loop variable scope: simultaneous possession and ingestion of cake

Oct. 10, 2008
10:14 a.m.
On 10/10/2008, Bruce Leban <bruce@leapyear.org> wrote:
Yes, that one would behave differently... so IF macros were added (which they won't), and IF someone would find it usefull to pass in the index variable through the macro, instead of just using a regular local variable and not exposing it (for which I don't see any use), this macro would have to be SLIGHTLY REWRITTEN. (And as there are no macros yet, there's no backward compatibility problem). New version: macro find(a, x, i): for j in range(len(x)): i = j # but why would you want that? if x[j]: z.append(lambda: x[j]) Jan
6004
Age (days ago)
6004
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jan Kanis