STINNER Victor added the comment:

> Another much larger change would be to change f_lasti to -2...

Attached lasti.patch implements this idea. I consider that it makes the C code 
simpler because getting the next instruction (f_lasti + 2) doesn't require a 
special case anymore.

My patch keeps f_lasti == -1 at the Python level for backward compatibility.

lasti.patch is only a backward incompatible change at the C level.

--

Between pygen_yf.patch and lasti.patch, I prefer lasti.patch even if 3.6 is at 
its last beta version before the final version. I prefer to fix the C API. 
Later it will be much harder to fix it.

--

I read again the wordcode issue #26647:

I wrote on the review of wpy7.patch: "The overall change LGTM, but I'm no more 
100% sure that starting f_lasti=-1 is safe."
http://bugs.python.org/review/26647/#msg17

I wrote: "IMHO it's ok to break the C API, but I would prefer to keep the 
backward compatibility for the Python API (replace any negative number with -1 
for the Python API)."
http://bugs.python.org/issue26647#msg262758

Serhiy: "I think we should make yet few related changes: (...) * Change 
f_lasti, tb_lasti etc to count code units instead of bytes."
http://bugs.python.org/issue26647#msg262758

----------
Added file: http://bugs.python.org/file45615/lasti.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to