Re: [Python-Dev] Solving the import-deadlock case

2013-07-03 Thread Pascal Chambon
Thanks for the comments, in my particular case we're actually on a provisioning /framework/, so we chose the easy (lazy?) way, i.e initializing miscellaneous modules at loading times (like Django or others do, I think), rather than building an proper initialization dispatcher to be called from

Re: [Python-Dev] Expose stack effects to Python?

2013-07-03 Thread Maciej Fijalkowski
I wrote a thing that adds more structure to dis (but is not finished) https://bitbucket.org/pypy/pypy/src/15b0489c15d8150b22815312dd283aa5bafcdd67/lib_pypy/disassembler.py?at=default On Wed, Jul 3, 2013 at 2:16 PM, Nick Coghlan wrote: > On 3 July 2013 20:06, Victor Stinner wrote: >> >> Hi, >> >>

Re: [Python-Dev] Expose stack effects to Python?

2013-07-03 Thread Nick Coghlan
On 3 July 2013 20:06, Victor Stinner wrote: > Hi, > > For my registervm project (fork of CPython using register-based > bytecode, instead of stack-based bytecode), I implemented a > Instruction.use_stack() method which just checks if the stack is > "used": read the stack, exchange values in the s

Re: [Python-Dev] Expose stack effects to Python?

2013-07-03 Thread Victor Stinner
Hi, For my registervm project (fork of CPython using register-based bytecode, instead of stack-based bytecode), I implemented a Instruction.use_stack() method which just checks if the stack is "used": read the stack, exchange values in the stack (like "ROT" instruction), push or pop a value. Inst

[Python-Dev] Expose stack effects to Python?

2013-07-03 Thread Larry Hastings
I wrote my own assembler for Python bytecode called "Maynard". I had to statically compute the stack effects for each bytecode instruction by hand; what I did was copied and pasted opcode_stack_effect() (which is static) out of Python/compile.c and into my own driver program, then I probed