This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Documentation for SETUP_WITH opcode is wrong
Type: Stage: resolved
Components: Documentation, Interpreter Core Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Dennis Sweeney, Mark.Shannon, andrei.avk, docs@python, iritkatriel, pxeger
Priority: normal Keywords: patch

Created on 2020-10-27 09:54 by pxeger, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27402 merged Dennis Sweeney, 2021-07-28 04:40
Messages (5)
msg379749 - (view) Author: Patrick Reader (pxeger) * Date: 2020-10-27 09:54
bpo-33387 introduced two new opcodes, `RERAISE` and `WITH_EXCEPT_START` (previously called `WITH_EXCEPT_FINISH`), replacing the previous `WITH_CLEANUP_START`, `WITH_CLEANUP_FINISH`,
`BEGIN_FINALLY`, `END_FINALLY`, `CALL_FINALLY` and `POP_FINALLY`.

The [documentation](https://docs.python.org/3.9/library/dis.html#opcode-SETUP_WITH) for it references the since removed `WITH_CLEANUP_START`, which is definitely wrong. I don't know enough to be able to fix it though, sorry, so I've added the core team.
msg398314 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-07-27 19:21
Note that SETUP_WITH doc was completely removed. Not sure if that was intentional (since the opcode itself still exists).
msg398315 - (view) Author: Patrick Reader (pxeger) * Date: 2021-07-27 19:26
It was, at least partially, replaced by BEGIN_WITH for bpo-40222: https://github.com/python/cpython/commit/adcd2205565f91c6719f4141ab4e1da6d7086126#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653bL741
msg398342 - (view) Author: Dennis Sweeney (Dennis Sweeney) * (Python committer) Date: 2021-07-28 04:10
Opcodes change from one version to another. You linked the Python 3.9 documentation. Python 3.9 opcodes are listed here: https://github.com/python/cpython/blob/3.9/Lib/opcode.py (and you can browse the branches and commit history for that file).

3.9 has SETUP_WITH, but not WITH_CLEANUP_START, so that particular doc entry is all that needs to change (assuming I'm not missing anything), since it wasn't updated during GH-6641.

I'll open a PR against the 3.9 docs.
msg398345 - (view) Author: Dennis Sweeney (Dennis Sweeney) * (Python committer) Date: 2021-07-28 04:55
GH-24334 already applied the necessary change for 3.10.
History
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86333
2021-07-28 19:16:54iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-07-28 04:55:22Dennis Sweeneysetnosy: + iritkatriel
messages: + msg398345
2021-07-28 04:40:26Dennis Sweeneysetkeywords: + patch
stage: patch review
pull_requests: + pull_request25935
2021-07-28 04:10:56Dennis Sweeneysetnosy: + Dennis Sweeney
messages: + msg398342
2021-07-27 19:26:58pxegersetmessages: + msg398315
versions: + Python 3.11
2021-07-27 19:21:41andrei.avksetnosy: + andrei.avk
messages: + msg398314
2020-10-27 10:05:21xtreaksetnosy: + Mark.Shannon
2020-10-27 09:54:48pxegercreate