Content-Length: 273860 | pFad | https://github.com/python/cpython/issues/123340

CC dis: IS_OP should provide the name of the op · Issue #123340 · python/cpython · GitHub
Skip to content

dis: IS_OP should provide the name of the op #123340

@JelleZijlstra

Description

@JelleZijlstra

Feature or enhancement

Proposal:

dis output does not show which IS_OP is being used (0 = is, 1 = is not):

>>> dis.dis("a is b")
  0           RESUME                   0

  1           LOAD_NAME                0 (a)
              LOAD_NAME                1 (b)
              IS_OP                    0
              RETURN_VALUE
>>> dis.dis("a is not b")
  0           RESUME                   0

  1           LOAD_NAME                0 (a)
              LOAD_NAME                1 (b)
              IS_OP                    1
              RETURN_VALUE

For comparison:

>>> dis.dis("a > b")
  0           RESUME                   0

  1           LOAD_NAME                0 (a)
              LOAD_NAME                1 (b)
              COMPARE_OP             132 (>)
              RETURN_VALUE

(Not planning to work on this myself.)

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/123340

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy