[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-09-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-09-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7bdf28265aa371b39f82dfc6562635801aff15a5 by Serhiy Storchaka in branch 'master': bpo-32455: Add jump parameter to dis.stack_effect(). (GH-6610) https://github.com/python/cpython/commit/7bdf28265aa371b39f82dfc6562635801aff15a5 --

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Kirill and was going to propose this change in a separate issue. -- ___ Python tracker

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Kirill Balunov
Kirill Balunov added the comment: Sorry if this doesn't fit this issue and needs a separate one. Since Python switched to 2 byte wordcode, all opcodes which do not imply an argument, technically have it - augmented with 0. So it is convenient to iterate over

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker ___

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 3.7 the stack effect is calculated more accurately by the compiler. PR 6610 exposes this feature to users. It add jump parameter to dis.stack_effect() and to PyCompile_OpcodeStackEffect(). By default the maximal value is

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-04-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6306 stage: -> patch review ___ Python tracker ___

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-01-03 Thread Larry Hastings
Larry Hastings added the comment: > 1. This will actually simplify the code for calculating the stack size. Simplify whose code, the caller or the callee? It seems like it's simplifying the life of the callee (PyCompile_OpcodeStackEffectEx) at the expense of pushing

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-01-03 Thread Larry Hastings
Change by Larry Hastings : -- nosy: +vstinner ___ Python tracker ___ ___

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 1. This will actually simplify the code for calculating the stack size. Instead of supporting special cases for jumping instructions in stackdepth_walk() you could just write something like new_depth = depth +

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-01-03 Thread Larry Hastings
Larry Hastings added the comment: The rationale: without this information, it is impossible for anybody else to write a bytecode compiler / assembler, because when you create a code object you have to specify its stack depth. I used this information for my "maynard"

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-01-03 Thread Benjamin Peterson
Benjamin Peterson added the comment: What was the rationale for exposing these interfaces in the first place? If they're not useful, I'd rather deprecate and remove them. -- nosy: +benjamin.peterson ___ Python tracker

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After resolving issue24340 I'm going to add PyCompile_OpcodeStackEffect() that takes an additional integer argument, and add an optional tristate argument to dis.stack_effect(). If it is True, return the effect when jump, if it

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-01-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2017-12-30 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The information provided by PyCompile_OpcodeStackEffect() and dis.stack_effect() (added in issue19722) is not enough for practical use. 1. Some opcodes (like JUMP_IF_TRUE_OR_POP or FOR_ITER) have different stack effect when