Skip to content
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

Resolve TODO's in the bytecode interpreter section #1077

Open
Christopher-Chianelli opened this issue Apr 17, 2023 · 2 comments
Open

Resolve TODO's in the bytecode interpreter section #1077

Christopher-Chianelli opened this issue Apr 17, 2023 · 2 comments
Labels

Comments

@Christopher-Chianelli
Copy link

Christopher-Chianelli commented Apr 17, 2023

Describe the enhancement or feature you'd like
The documentation for the bytecode interpreter has a variety of TODO's: https://devguide.python.org/internals/interpreter/:

  • Exception chaining > Other exception details.
  • The call stack > Also frame layout and use, and “locals plus”.
  • All sorts of variables > Write the rest of this section. Alas, the author got distracted and won’t have time to continue this for a while.

Additionally, some TODO's correspond to new sections that need to be created:

  • co_consts, co_names, co_varnames, and their ilk
  • How calls work (how args are transferred, return, exceptions)
  • Generators, async functions, async generators, and yield from (next, send, throw, close; and await; and how this code breaks the interpreter abstraction)
  • Eval breaker (interrupts, GIL)
  • Tracing
  • Setting the current lineno (debugger-induced jumps)
  • Specialization, inline caches etc. (outdated? There is https://devguide.python.org/internals/interpreter/#inline-cache-entries)

Completing these TODO's would make the bytecode interpreter section of the devguide more complete, reducing the variety of places that need to be searched in order to understand how the interpreter works.

Describe alternatives you've considered
Remove the TODO's and leave the rest of the documentation as is (Status Quo).

Additional context
A guide to "All sorts of variables" I found useful when implementing my own bytecode interpreter:

@encukou
Copy link
Member

encukou commented Apr 18, 2023

PRs would be very welcome. Guido (the author) ran out of time/energy and published what he had, see the original PR.

@Lincoln-developer
Copy link
Contributor

Hey, I would love to work on this issue.

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

No branches or pull requests

5 participants