|
|
|
|
|
by adrusi
5101 days ago
|
|
it's a closure, but it's not an anonymous function; it has a name! "anonymous function" is a syntactic feature but "lexical closure" is a language feature. In python "anonymous functions" can comprise only one expression: `lambda x: x * 2`, but that's not the only way to make a lexical closure, you can also do: def foo(x):
return x * 2
and then use `foo` in place of the anonymous function literal. |
|
If you have 5 different things that are all different but supposedly have the same name, what does it mean to have a name?