Skip to content

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

Closed

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

Activity

  1. self-assigned this
    on Aug 26, 2024
  2. sobolevn commented on Aug 26, 2024

    @sobolevn
    Member

    I have some free time to work on this :)

  3. added a commit that references this issue on Aug 26, 2024
  4. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Aug 26, 2024
  5. added a commit that references this issue on Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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