"Structural pattern matching" for Python, part 2
"Structural pattern matching" for Python, part 2
Posted Sep 3, 2020 14:17 UTC (Thu) by sbaugh (guest, #103291)In reply to: "Structural pattern matching" for Python, part 2 by NYKevin
Parent article: "Structural pattern matching" for Python, part 2
>Moreover, I've never run into a situation where it actually causes a problem of some sort.
Isn't the fact that Python functions aren't true closures a direct consequence of its lack of proper lexical scope? I'd say that causes a *lot* of problems:
>>> fs = [lambda: i for i in range(5)]
>>> [f() for f in fs]
[4, 4, 4, 4, 4]
