|
|
|
|
|
by pjmlp
1129 days ago
|
|
Nothing prevents a Python dynamic compiler to follow a similar approach though, specially now that type annotations are part of the language. And in any case, there are the Smalltalk and SELF JITs as an example of highly dynamic environments, where anything goes. |
|
Python could have a declaration which says, "this function/module doesn't participate in anything stupidly dynamic, like access to parent locals". If it calls some code which tries to access parent locals, the behavior is undefined.
That's kind of a bad thing because in Lisp I don't have to declare anything unsafe to a compiler just to have reasonably efficient local variables that can be optimized away and all that.