getting the current function
jgardner.jonathangardner.net at gmail.com
Thu Sep 6 23:07:20 CEST 2007
On Sep 6, 8:43 am, Gary Robinson <gary... at mac.com> wrote:
> I welcome feedback of any type.
This all seems a bit too complicated. Are you sure you want to do
this? Maybe you need to step back and rethink your problem.
Your example can be rewritten a number of different ways that are
easier to think about.
The simple approach:
_x_counter = 0
_x_counter += 1
The generator approach:
x = 0
x += 1
counter = counter_gen()
counter.next() # etc...
A class-based approach:
self._x = 0
self._x += 1
In general, there really isn't a need to mess with stack frames unless
you are really interested in looking at the stack frame.
More information about the Python-list