New submission from Larry Hastings: Attached is a patch exposing the old opcode_stack_effect() function to Python. The patch does the following:
* renames opcode_stack_effect() to PyCompile_OpcodeStackEffect() * removes the "static" modifier from PyCompile_OpcodeStackEffect() * changes PyCompile_OpcodeStackEffect()'s behavior so it returns a magic value on failure * preserves existing behavior when compiling code and encountering an opcode/oparg pair that results in failure * creates a new _opcode module * exposes PyCompile_OpcodeStackEffect() as _opcode.stack_effect() * tests _opcode module with new test__opcode.py * imports _opcode.stack_effect() into opcode, exposing it publically * documents the function in dis (there is no documentation for opcode, and dis imports and exposes everything in opcode) Whew! I think it's ready to go in. ---------- assignee: larry components: Library (Lib) files: larry.expose.stack.effect.patch.1.diff keywords: patch messages: 203845 nosy: larry, ncoghlan priority: normal severity: normal stage: patch review status: open title: Expose stack effect calculator to Python type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file32781/larry.expose.stack.effect.patch.1.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19722> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com