[Python-Dev] New Super PEP

Dino Viehland dinov at exchange.microsoft.com
Thu May 31 00:46:28 CEST 2007


>>> Being able to access the calling frame from IronPython would be really
>>> useful...

We do have a -X:Frames option but it's going to hurt your performance, but for example:

IronPython 1.0.60816 on .NET 2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.
>>> def f():
...     x = locals
...     print x()
...
>>> f()
{'__name__': '__main__', '__builtins__': <type '__builtin__'>, '__doc__': None, 'site': <module 'site' from 'C:\Product\Released\IronPython-1.0\Lib\site.py'>, '
f': <function f at 0x000000000000002B>}
>>> ^Z

C:\Product\Released\IronPython-1.0>.\ipy.exe -X:Frames
IronPython 1.0.60816 on .NET 2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.
>>> def f():
...     x = locals
...     print x()
...
>>> f()
{'x': <built-in function locals>}
>>> ^Z

But then we'll NEVER use the CLR stack for storing locals, but we can also always get the calling frames.




More information about the Python-Dev mailing list