>>> def f(): pass
...
>>> f.func_globals
{'A': <class __main__.A at 0x465d20>, 'a': <__main__.A instance at
0x470260>, 'f': <function f at 0x46a630>, '__builtins__': <module
'__builtin__' (built-in)>, '__name__': '__main__', '__doc__': None}
>>> globals()
{'A': <class __main__.A at 0x465d20>, 'a': <__main__.A instance at
0x470260>, 'f': <function f at 0x46a630>, '__builtins__': <module
'__builtin__' (built-in)>, '__name__': '__main__', '__doc__': None}
>>> f.func_globals is globals()
True

I am trying to understand the exact dynamics. For example:

  g,l={},{}
  exec code in g,l

does not create any leak but this does:

  exec code in g



On Jan 8, 5:09 pm, Jonathan Lundell <jlund...@pobox.com> wrote:
> On Jan 8, 2011, at 2:48 PM, Massimo Di Pierro wrote:
>
>
>
> > In the case of web2py "exec code in {}" creates the circular reference
> > for objects defined in the code.
>
> What is the circular reference?

Reply via email to