Skip to content

Resolve TODO's in the bytecode interpreter section #1077

Open
@Christopher-Chianelli

Description

@Christopher-Chianelli

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:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions