Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change dis output to display labels instead of offsets #112137

Closed
Assignees
iritkatriel
Labels
stdlibPython modules in the Lib dirtype-featureA feature request or enhancement
@iritkatriel

Description

@iritkatriel

TODO:

  • test for output with offsets
  • -- instead ofNone for missing line number? - in another PR.

Feature or enhancement

>>> def f():...     for i in x:...         if y:...           z... >>> dis.dis(f)  1           RESUME                   0  2           LOAD_GLOBAL              0 (x)              GET_ITER        L1:   FOR_ITER                22 (to L3)              STORE_FAST               0 (i)  3           LOAD_GLOBAL              2 (y)              TO_BOOL              POP_JUMP_IF_TRUE         2 (to L2)              JUMP_BACKWARD           16 (to L1)  4     L2:   LOAD_GLOBAL              4 (z)              POP_TOP              JUMP_BACKWARD           24 (to L1)  2     L3:   END_FOR              RETURN_CONST             0 (None)

This is easier to read than the current output of:

>>> dis.dis(f)  1           0 RESUME                   0  2           2 LOAD_GLOBAL              0 (x)             12 GET_ITER        >>   14 FOR_ITER                22 (to 62)             18 STORE_FAST               0 (i)  3          20 LOAD_GLOBAL              2 (y)             30 TO_BOOL             38 POP_JUMP_IF_TRUE         2 (to 46)             42 JUMP_BACKWARD           16 (to 14)  4     >>   46 LOAD_GLOBAL              4 (z)             56 POP_TOP             58 JUMP_BACKWARD           24 (to 14)  2     >>   62 END_FOR             64 RETURN_CONST             0 (None)

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp