Re: Injecting new names into the above frame

2008-09-13 Thread Boris Borcic
Why don't you use import and __import__() ? - They seem designed for such an application. I mean, I am not against vicious hacks for the fun of them, but not if they serve the illusion that what they do can't (easily) be achieved other ways. Cheers, BB Peter Waller wrote: Dear Pythoners, I

Re: Injecting new names into the above frame

2008-09-13 Thread Michele Simionato
On Sep 13, 1:35 pm, Peter Waller <[EMAIL PROTECTED]> wrote: > This makes me want to ask: is it difficult to modify a function's > code? No, it is not difficult. Look at the byteplay module: it makes possible all kinds of dirty hacks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting new names into the above frame

2008-09-13 Thread Peter Waller
On Sep 12, 2:30 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > The answer to why this doesn't work lies in the disassembly of that > function: This makes me want to ask: is it difficult to modify a function's code? Even if it weren't possible whilst the function was executing (because then I wou

Re: Injecting new names into the above frame

2008-09-12 Thread Carsten Haese
Peter Waller wrote: > Dear Pythoners, > > I know this will probably be perceived as 'evil voodoo', and fair > enough: it probably is. I guess it is unpythonic. > > .. but I want to know how to do it anyway - mostly for my own > interest. Well, if you're really just asking out of curiosity, it sh

Injecting new names into the above frame

2008-09-12 Thread Peter Waller
Dear Pythoners, I know this will probably be perceived as 'evil voodoo', and fair enough: it probably is. I guess it is unpythonic. .. but I want to know how to do it anyway - mostly for my own interest. Consider the following snippet of code: --- def Get( *names ): if not names: return Non