This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients benjamin.peterson, brett.cannon, pablogsal, serhiy.storchaka, yselivanov
Date 2020-03-17.06:54:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584428070.24.0.802483669477.issue39987@roundup.psfhosted.org>
In-reply-to
Content
Currently the compiler can set the line number to the instruction or keep it unset (zero). Then, when create linenotab it adds entries only for set line numbers. But in rare cases (docstring or the first instruction in the module, definition of a function with default arguments, maybe more) it may add multiple entries for the same lineno even if the bytecode offset is less than 255. Seems the only effect of this is a suboptimal linenotab.

The proposed PR simplifies setting the line number in the compiler (it was the primary goal) and also fixes the above minor issue. The simplification is needed for several future changes in the compiler.
History
Date User Action Args
2020-03-17 06:54:30serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, benjamin.peterson, yselivanov, pablogsal
2020-03-17 06:54:30serhiy.storchakasetmessageid: <1584428070.24.0.802483669477.issue39987@roundup.psfhosted.org>
2020-03-17 06:54:30serhiy.storchakalinkissue39987 messages
2020-03-17 06:54:29serhiy.storchakacreate