Skip to content

xdis.stack_effect is not exposed properly #188

@Quinntyx

Description

@Quinntyx

Description

xdis.stack_effect is implemented in xdis.std, but is missing from module-level exports, so it cannot be accessed at xdis.stack_effect. This breaks parity with dis, which has dis.stack_effect exposed externally.

How to Reproduce

>>> import xdis
>>> xdis.stack_effect
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    xdis.stack_effect
AttributeError: module 'xdis' has no attribute 'stack_effect'
>>> import dis
>>> dis.stack_effect
<built-in function stack_effect>
>>> 

Expected behavior

Accessing xdis.stack_effect should give the stack effect function.

Environment

Using xdis installed from git main branch (via pip install git+https://github.com/rocky/python-xdis.git).

Running on Python 3.15.0b1+.

Workarounds

Can access from _std_api directly.

>>> from xdis.std import _std_api
>>> _std_api.stack_effect
<bound method _StdApi.stack_effect of <xdis.std._StdApi object at 0x7f18fcb17cb0>>
>>> 

Priority

Not particularly important, the workaround is very easy. However, it does break any uses of xdis for drop-in replacement of dis if the stack_effect function is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions