[issue19722] Expose stack effect calculator to Python

2014-03-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4a801f8b7e2d by R David Murray in branch 'default': whatsnew: dis.stack_effect (#19722). http://hg.python.org/cpython/rev/4a801f8b7e2d -- ___ Python tracker __

[issue19722] Expose stack effect calculator to Python

2013-11-23 Thread Larry Hastings
Changes by Larry Hastings : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue19722] Expose stack effect calculator to Python

2013-11-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5fe72b9ed48e by Larry Hastings in branch 'default': Issue #19722: Added opcode.stack_effect(), which accurately http://hg.python.org/cpython/rev/5fe72b9ed48e -- nosy: +python-dev ___ Python tracker

[issue19722] Expose stack effect calculator to Python

2013-11-23 Thread Larry Hastings
Larry Hastings added the comment: Attached is revision 3 of the patch. I'm gonna check it in pretty soon, so as to make beta (and feature freeze). I changed the API so the oparg is optional, and it raises if it gets one it shouldn't have or didn't get one when it should. -- Added fil

[issue19722] Expose stack effect calculator to Python

2013-11-23 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I argued myself into realising EXTENDED_ARG just needed to be mentioned in the function docs, but didn't go back and fix my opening paragraph. The fact dis uses an arg of None (rather than zero) to indicate "no argument" means I think the extra layer of wrap

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Larry Hastings
Larry Hastings added the comment: stack_effect will never know about EXTENDED_ARG. Instead, you simply pass the already-extended arg as the second argument. Making the second argument support a default of None will be slightly inconvenient, but I'll do it if you think it's a big improvement.

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Nick Coghlan
Nick Coghlan added the comment: Hmm, looking at dis.py, I'm -1 on exposing this as a public opcode module API at this point, although I'm still a fan of exposing it as opcode._stack_effect to allow advanced users access (ala sys._get_frames). I initially thought the required addition to dis.In

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Nick Coghlan
Nick Coghlan added the comment: +1 from me. A stack_effect attribute on dis.Instruction would be a nice bonus, but doesn't need to be part of this patch. -- ___ Python tracker __

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Larry Hastings
Larry Hastings added the comment: New patch, incorporating Antoine's comments. Thanks, Antoine! -- Added file: http://bugs.python.org/file32782/larry.expose.stack.effect.patch.2.diff ___ Python tracker __

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Eric Snow
Eric Snow added the comment: FWIW, I agree with Antoine about making those PyCompile_ functions private (leading "_"). -- nosy: +eric.snow ___ Python tracker ___ ___

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Larry Hastings
Changes by Larry Hastings : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Larry Hastings
Larry Hastings added the comment: (Sponging around for a reviewer ;-) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue19722] Expose stack effect calculator to Python

2013-11-22 Thread Larry Hastings
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 PyCompi