Re: [Tutor] Accessing callers context from callee method

2009-02-25 Thread mobiledreamers
i found the solution This is my first attempt at memcaching html page using cheetah since cheetah render needs locals() i use getCallerInfo() to get the locals() and send to memcached let me know if it is possible to better do this *notice getCallerInfo * *utils.py* @log_time_func def renderpage(k

Re: [Tutor] Accessing callers context from callee method

2009-02-25 Thread mobiledreamers
i found the solution This is my first attempt at memcaching html page using cheetah since cheetah render needs locals() i use getCallerInfo() to get the locals() and send to memcached let me know if it is possible to better do this *notice getCallerInfo * *utils.py* @log_time_func def renderpage(k

Re: [Tutor] Accessing callers context from callee method

2009-02-24 Thread A.T.Hofkamp
mobiledream...@gmail.com wrote: when i call a method foo from another method func. can i access func context variables or locals() from foo so def func(): i=10 foo() in foo, can i access func's local variables on in this case i As others have already pointed out, this is a really bad idea.

Re: [Tutor] Accessing callers context from callee method

2009-02-24 Thread Alan Gauld
wrote when i call a method foo from another method func. can i access func context variables or locals() from foo Yes and there are several ways to do it, but nearly always this is a bad idea. It will make foo almost totally unusable in any other context since it will rely on the calling fu

Re: [Tutor] Accessing callers context from callee method

2009-02-24 Thread wesley chun
> when i call a method foo from another method func. can i access func context > variables or locals() from foo > so > def func(): >   i=10 >   foo() > > in foo, can i access func's local variables A. python has statically-nested scoping, so you can do it as long as you: 1. define foo() as an in

Re: [Tutor] Accessing callers context from callee method

2009-02-24 Thread Chris Rebert
On Tue, Feb 24, 2009 at 10:53 AM, wrote: > when i call a method foo from another method func. can i access func context > variables or locals() from foo > so > def func(): >   i=10 >   foo() > > in foo, can i access func's local variables on in this case i You can, but it's an evil hack that I w

Re: [Tutor] Accessing callers context from callee method

2009-02-24 Thread spir
Le Tue, 24 Feb 2009 10:53:29 -0800, mobiledream...@gmail.com s'exprima ainsi: > when i call a method foo from another method func. can i access func context > variables or locals() from foo > so > def func(): > i=10 > foo() > > in foo, can i access func's local variables on in this case i > T

[Tutor] Accessing callers context from callee method

2009-02-24 Thread mobiledreamers
when i call a method foo from another method func. can i access func context variables or locals() from foo so def func(): i=10 foo() in foo, can i access func's local variables on in this case i Thanks a lot -- Bidegg worlds best auction site http://bidegg.com ___