[Python-Dev] [PEP 558] thinking through locals() semantics

Random832 random832 at fastmail.com
Sun Jun 2 13:33:10 EDT 2019


On Wed, May 29, 2019, at 01:25, Nick Coghlan wrote:
> Having a single locals() call de-optimize an entire function would be 
> far from ideal.

What if there were a way to explicitly de-optimize a function, rather than guessing the user's intent based on looking for locals and exec calls (both of which are builtins which could be shadowed or assigned to other variables)?

Also, regardless of anything else, maybe in an optimized function locals should return a read-only mapping?


More information about the Python-Dev mailing list