Author serhiy.storchaka
Recipients eric.smith, serhiy.storchaka
Date 2016-09-30.14:21:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475245280.55.0.378844922584.issue28317@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2016-09-30 14:21:20serhiy.storchakasetrecipients: + serhiy.storchaka, eric.smith
2016-09-30 14:21:20serhiy.storchakasetmessageid: <1475245280.55.0.378844922584.issue28317@psf.upfronthosting.co.za>
2016-09-30 14:21:20serhiy.storchakalinkissue28317 messages
2016-09-30 14:21:20serhiy.storchakacreate