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: Improve support of FORMAT_VALUE in dis
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: eric.smith, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-09-30 14:21 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
dis_format_string.patch serhiy.storchaka, 2016-09-30 14:21 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft, 2017-03-31 16:36
Messages (2)
msg277754 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-30 14:21
FORMAT_VALUE packs the information about conversion flags and boolean flag that denotes whether format specifier is passed on the stack in one integer argument. It is not easy to decode this information in disassemble output. Proposed patch makes disassembler producing human readable representation of FORMAT_VALUE argument.

$ echo 'f"{a} {b:4} {c!r} {d!r:4}"' | ./python -m dis
  1           0 LOAD_NAME                0 (a)
              2 FORMAT_VALUE             0
              4 LOAD_CONST               0 (' ')
              6 LOAD_NAME                1 (b)
              8 LOAD_CONST               1 ('4')
             10 FORMAT_VALUE             4 (with format)
             12 LOAD_CONST               0 (' ')
             14 LOAD_NAME                2 (c)
             16 FORMAT_VALUE             2 (repr)
             18 LOAD_CONST               0 (' ')
             20 LOAD_NAME                3 (d)
             22 LOAD_CONST               1 ('4')
             24 FORMAT_VALUE             6 (repr, with format)
             26 BUILD_STRING             7
             28 POP_TOP
             30 LOAD_CONST               2 (None)
             32 RETURN_VALUE
msg278288 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-10-08 09:35
New changeset 5e81d14a52f7 by Serhiy Storchaka in branch '3.6':
Issue #28317: The disassembler now decodes FORMAT_VALUE argument.
https://hg.python.org/cpython/rev/5e81d14a52f7

New changeset 085944763f3a by Serhiy Storchaka in branch 'default':
Issue #28317: The disassembler now decodes FORMAT_VALUE argument.
https://hg.python.org/cpython/rev/085944763f3a
History
Date User Action Args
2022-04-11 14:58:37adminsetgithub: 72504
2017-03-31 16:36:26dstufftsetpull_requests: + pull_request1000
2016-10-08 09:35:45serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-10-08 09:35:24python-devsetnosy: + python-dev
messages: + msg278288
2016-10-07 20:54:08serhiy.storchakasetassignee: serhiy.storchaka
2016-09-30 14:21:20serhiy.storchakacreate