Skip to content

Handle argrepr possibly not being populated#31

Merged
davep merged 2 commits intomainfrom
load-small-int-issue
Oct 16, 2025
Merged

Handle argrepr possibly not being populated#31
davep merged 2 commits intomainfrom
load-small-int-issue

Conversation

@davep
Copy link
Copy Markdown
Owner

@davep davep commented Oct 16, 2025

With Python 3.14 at least one opcode (LOAD_SMALL_INT) seems to not populate argrepr when there is an argval. This is quite different from all other opcodes I've seen so far. I suspect this might be a bug with Python 3.14's dis module, but that's a digging session for another time (to be clear: dis.dis shows the value; but the Instruction from Bytecode doesn't have a populated argrepr).

So here I change things so that I use argrepr if it is populated, otherwise I repr argval if it isn't None. Technically this could result in a false negative if there's a genuine None as the argval, but then I'd hope that argrepr is populated with "None".

With Python 3.14 at least one opcode (LOAD_SMALL_INT) seems to not populate
argrepr when there is an argval. This is quite different from all other
opcodes I've seen so far. I suspect this might be a bug with Python 3.14's
dis module, but that's a digging session for another time (to be clear:
dis.dis shows the value; but the Instruction from Bytecode doesn't have a
populated argrepr).

So here I change things so that I use argrepr if it is populated, otherwise
I repr argval if it isn't None. Technically this could result in a false
negative if there's a genuine None as the argval, but then I'd hope that
argrepr is populated with "None".
@davep davep self-assigned this Oct 16, 2025
@davep davep added the Bug Something isn't working label Oct 16, 2025
@davep davep marked this pull request as ready for review October 16, 2025 19:09
@davep davep merged commit c50eaab into main Oct 16, 2025
3 checks passed
@davep davep deleted the load-small-int-issue branch October 16, 2025 19:09
@davep
Copy link
Copy Markdown
Owner Author

davep commented Oct 17, 2025

I've since reported what I noticed in the Python repo, in case it's a genuine bug: python/cpython#140256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant