I'll grant you that a class isn't an anonymous function, arguably it's the same with lambdas that aren't as powerful as proper function defs.
But I'm not sure this is a problem. In fact, in some ways it may be advantageous e.g. static analysis.
I'd need a use-case for the anonymous closure, but a generator is a basic concept in python, so I son't think it's any trickier than a js function.
I know how in js there is a degree of 'binding' scope and hiding functionality in closures - I think in python (for better or worse) things would by convention be implemented differently.
As an aside, would you say js scope/closure approach is a bit similar to the approach in R?
But I'm not sure this is a problem. In fact, in some ways it may be advantageous e.g. static analysis.
I'd need a use-case for the anonymous closure, but a generator is a basic concept in python, so I son't think it's any trickier than a js function.
I know how in js there is a degree of 'binding' scope and hiding functionality in closures - I think in python (for better or worse) things would by convention be implemented differently.
As an aside, would you say js scope/closure approach is a bit similar to the approach in R?