8000 CACHE and SWAP documentation is vague with the meaning of the oparg · Issue #96461 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

CACHE and SWAP documentation is vague with the meaning of the oparg #96461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MatthieuDartiailh opened this issue Aug 31, 2022 · 3 comments
Closed
Labels
docs Documentation in the Doc dir

Comments

@MatthieuDartiailh
Copy link
Contributor
MatthieuDartiailh commented Aug 31, 2022

Documentation

The current documentation says that CACHE and SWAP acts on the ith element of the stack but it is nowhere mentioned if the stack is indexed from 0 or 1. Looking at the actual implementation in ceval.c makes the answer obvious but it is tedious and the documentation could be improved I believe.

@MatthieuDartiailh MatthieuDartiailh added the docs Documentation in the Doc dir label Aug 31, 2022
markshannon pushed a commit that referenced this issue Jan 12, 2023
* Clarify the meaning of the oparg for CACHE and COPY opcode in dis doc

* Use STACK to describe stack operation in analogy with a Python list

* Remove (delta) from BEFORE_WITH since BEFORE_WITH does not take an argument

* Fix the description of the stack impact of multiple opcodes
@hauntsaninja
Copy link
Contributor

Should this PR have been backported to 3.11?

@MatthieuDartiailh
Copy link
Contributor Author
MatthieuDartiailh commented Jan 20, 2023

It could be but 3.12 already changed quite a bit the bytecode and the back port would not be straightforward.

@hauntsaninja
Copy link
Contributor

Okay, thanks, I'll close this then :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants
0