Closures python,scheme,ruby - a good explanation of the somewhat faulty lookups for lexical variables in Python (at least when an assignment is involved in an inner scope).