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.

classification
Title: dis output for LOAD_CONST is confusing
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, iritkatriel
Priority: normal Keywords: patch

Created on 2021-09-10 23:31 by iritkatriel, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28313 merged iritkatriel, 2021-09-13 14:26
Messages (3)
msg401620 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-10 23:31
When dis doesn't have co_consts, it just prints the index of the const in () instead. This is both unnecessary and confusing because (1) we already have the index and (2) there is no indication that this is the index and not the value. 

Can we change the output so that it doesn't print the value if it's missing?
msg401621 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-10 23:31
See example here:
https://github.com/iritkatriel/cpython/pull/30/files#r706517665
msg401764 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-14 09:09
New changeset c99fc4e53a60084df88ac5c69b3b13bc033677e1 by Irit Katriel in branch 'main':
bpo-45168: change dis output to omit missing values rather than replacing them by their index (GH-28313)
https://github.com/python/cpython/commit/c99fc4e53a60084df88ac5c69b3b13bc033677e1
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89331
2021-09-14 09:11:28iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-09-14 09:09:13iritkatrielsetmessages: + msg401764
2021-09-13 14:26:20iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request26726
2021-09-10 23:31:40iritkatrielsettitle: dis output for co_consts is confusing -> dis output for LOAD_CONST is confusing
2021-09-10 23:31:26iritkatrielsettype: behavior
messages: + msg401621
components: + Library (Lib)
versions: + Python 3.11
2021-09-10 23:31:01iritkatrielcreate