Re: [Python-Dev] Can I introspect/reflect to get arguments exec()?

2013-03-28 Thread Rocky Bernstein
3 at 11:00 PM, Rocky Bernstein wrote: > > Okay. But is the string is still somewhere in the CPython VM stack? (The > > result of LOAD_CONST 4 above). Is there a way to pick it up from there? > > Maybe using C you could peek into the frame's value stack, but that's > n

Re: [Python-Dev] Can I introspect/reflect to get arguments exec()?

2013-03-26 Thread Rocky Bernstein
On Tue, Mar 26, 2013 at 10:18 PM, Benjamin Peterson wrote: > 2013/3/26 Rocky Bernstein : > > [asked on comp.lang.python but no takers. So I'm bumping it up a notch.] > > > > I have ported my Python debugger pydbgr to Python3. See [1] or [2]. > > > > Insi

[Python-Dev] Can I introspect/reflect to get arguments exec()?

2013-03-26 Thread Rocky Bernstein
[asked on comp.lang.python but no takers. So I'm bumping it up a notch.] I have ported my Python debugger pydbgr to Python3. See [1] or [2]. Inside the debugger, when there is an exec() somewhere in the call stack, I'd like to be able to retrieve the string parameter. With this, the debugger can

[Python-Dev] License for code extracted from a Python library?

2009-07-28 Thread Rocky Bernstein
Hi - I'm not sure if this is the right place to ask this, but I don't know of a more appropriate place. Sometime around 2007 I first extracted a function that was in Python's Cmd class and used that. Since then, I have modified and generalized it a bit more and turned it into a Python egg called

[Python-Dev] code.interact() locals + globals?

2009-02-21 Thread Rocky Bernstein
I notice code.interact() in Python 2.6 has a parameter for locals but not globals. Should it? Ultimately, *exec* is used underneath so I don't see a technical reason why it couldn't add a global parameter. Also, although one could pass in a dictionary that is the merger or update() of locals() a

Re: [Python-Dev] Should there be a source-code checksum in module objects?

2009-02-03 Thread rocky
Guido van Rossum writes: > I suggest that you move this discussion to python-ideas to ferret out > a possible implementation and API; or to find out work-arounds. Okay. Done. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

Re: [Python-Dev] Should there be a source-code checksum in module objects?

2009-02-02 Thread rocky
Brett Cannon writes: > On Mon, Feb 2, 2009 at 00:52, Rocky Bernstein wrote: > > As I've mentioned, I've been re-examining from ground up the whole > > state of affairs in writing a debugger. > > > > One of the challenges of a debugger or any source-code

[Python-Dev] Should there be a source-code checksum in module objects?

2009-02-02 Thread Rocky Bernstein
As I've mentioned, I've been re-examining from ground up the whole state of affairs in writing a debugger. One of the challenges of a debugger or any source-code analysis tool is verifying that the source-code that the tool is reporting on corresponds to the compiled object under execution. (For d

Re: [Python-Dev] Should execv() call _run_exitfuncs()? If not, should _run_exitfuncs() be private?

2009-02-01 Thread rocky
Guido van Rossum writes: > Depending on the use for the exit function you might or might not want > it run at the occasion of exec*(). E.g. I imagine that in a typical > fork() + exec*() scenario, calling the exit functions in the child > process would be a mistake. > > So I don't think the

[Python-Dev] Should execv() call _run_exitfuncs()? If not, should _run_exitfuncs() be private?

2009-01-31 Thread Rocky Bernstein
As a hobby I've been writing a debugger. One of the commands,"restart", works by calling an execv(). You may need to do this when the program you are debugging is threaded or when one needs to ensure that all program state is reinitialized. Recently, I added remote debugging via TCP sockets and no

Re: [Python-Dev] Should there be a way or API for retrieving from a code object a loader method and package file where the code comes from?

2008-12-23 Thread rocky
Paul Moore writes: > 2008/12/23 R. Bernstein : > > A use case here I am thinking of here is in a stack trace or a > > debugger, or a tool which wants to show in great detail, information > > from a code object obtained possibly via a frame object. > > Thanks for the clarifications. I see

Re: [Python-Dev] Should there be a way or API for retrieving from a code object a loader method and package file where the code comes from?

2008-12-23 Thread rocky
Paul Moore writes: > 2008/12/23 Rocky Bernstein : > > Now that there is a package mechanism (are package mechanisms?) like > > zipimporter that bundle source code into a single file, should the > > notion of a "file" location should be adjusted to include t

[Python-Dev] Should there be a way or API for retrieving from a code object a loader method and package file where the code comes from?

2008-12-23 Thread Rocky Bernstein
Now that there is a package mechanism (are package mechanisms?) like zipimporter that bundle source code into a single file, should the notion of a "file" location should be adjusted to include the package and/or importer? Is there a standard API or routine which can extract this information given