(Email resent, I first sent it to Nick privately by mistake.) 2017-11-02 2:53 GMT+01:00 Nick Coghlan <ncogh...@gmail.com>: > The piece that we're currently missing to make such workflows easier to > manage is an equivalent of JavaScript's source maps (...)
Code objects already have a instruction pointer => line number mapping table: the code.co_lnotab field. It's documented at: https://github.com/python/cpython/blob/master/Objects/lnotab_notes.txt This table is built from the line number information of the AST tree. The mapping table is optimized to be small. Before Python 3.5, line number had to be monotonic. Since Python 3.6, you "move" instructions at the AST level, and so have "non-monotonic" line numbers (ex: line 1, line 3, line 2, line 4). Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com