Phillip shows some examples involving inner functions defined inside the for loop. But in current Python these examples work just as well if the function is defined *outside* the loop (as long as no default argument values are needed): > for x in 1,2,3: > def y(): > print z > z = x * 2 > y() is the same as def y(): print z for x in 1, 2, 3: z = x*2 y() That would change under Phillip's proposal. There are similar examples that would break under Greg's original proposal: just use the loop variable in the function, e.g.: def y(): print x*2 for x in 1, 2, 3: y() All this is just more reason to put this one off until 3.0. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4