Re: inspect.stack() and frame

2010-03-12 Thread MRAB
Félix-Antoine Fortin wrote: Thanks Gabriel, you resumed quite well what I did discovered after my second post by playing with the garbage collector module. (The garbage collector will, eventually, break the cycle and free those objects, but not very soon). I'm not very familiar with the Pyth

Re: inspect.stack() and frame

2010-03-12 Thread Félix-Antoine Fortin
Thanks Gabriel, you resumed quite well what I did discovered after my second post by playing with the garbage collector module. > (The garbage collector will,   > eventually, break the cycle and free those objects, but not very soon). I'm not very familiar with the Python garbage collector, so yo

Re: inspect.stack() and frame

2010-03-11 Thread Gabriel Genellina
En Thu, 11 Mar 2010 21:03:07 -0300, Félix-Antoine Fortin escribió: On Mar 11, 6:22 pm, "Alf P. Steinbach" wrote: * F lix-Antoine Fortin: > Given this code : > # Experience with frame > import sys > import inspect > def foo(): > stack = inspect.stack() > print "foo frame : " + str(he

Re: inspect.stack() and frame

2010-03-11 Thread Félix-Antoine Fortin
On Mar 11, 6:22 pm, "Alf P. Steinbach" wrote: > * F lix-Antoine Fortin: > > > Given this code : > > # Experience with frame > > import sys > > import inspect > > > def foo(): > >     stack = inspect.stack() > >     print "foo frame : " + str(hex(id(sys._getframe( > > hex returns a string. appl

Re: inspect.stack() and frame

2010-03-11 Thread Alf P. Steinbach
* Félix-Antoine Fortin: Given this code : # Experience with frame import sys import inspect def foo(): stack = inspect.stack() print "foo frame : " + str(hex(id(sys._getframe( hex returns a string. applying str is therefore redundant. def foo2(): inspect.stack() print "f

inspect.stack() and frame

2010-03-11 Thread Félix-Antoine Fortin
Given this code : # Experience with frame import sys import inspect def foo(): stack = inspect.stack() print "foo frame : " + str(hex(id(sys._getframe( def foo2(): inspect.stack() print "foo2 frame : " + str(hex(id(sys._getframe( def bar(): print "bar frame : " + str(