They were "unbroken" in Python 3, though because of the way scoping works in the language it requires marking variables (with `nonlocal`)
Because they use explicit local declaration (and implicitly declared variables are global in both)…
And I could hardly agree more with that, I simply disagree that Python's closures remain broken, they're simply fixed within the constraints set by previous design decisions.
> at least with "global by default" you can use a linter to enforce that all your globals are explicitly declared
Still, there's really no excuse for global as default, there's no convenience justification and could just as easily be an error (more easily really)
The fact that I have to distinguish between `global`, `nonlocal` and `default` scope makes them broken. `nonlocal` is a hack.
Saying that it's a result of previous design decisions is a sound technical reason for why `nonlocal` is necessary to make closures work. But as an abstraction, at least, they are broken.
With that, I will concede that they are broken in two different ways between Python 2 and Python 3. This is IMO.
TL;DR - "I have never considered Python to be heavily influenced by functional languages, no matter what people say or think."
Python, IMO, has flutters of functional programming in it. But its broken closures, lack of uncripppled anonymous functions and lack of tail-call optimization are pretty damning strikes against calling Python's support for functional programming similar to its support for imperative or OO paradigms. It just isn't. Yeah, we get `map` and `filter`, big whoop. :-)