https://github.com/python/cpython/commit/13fee461c2372ada05f33245b2fc5e341890e7af
commit: 13fee461c2372ada05f33245b2fc5e341890e7af
branch: main
author: Langyan <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2026-05-29T15:44:20+05:30
summary:
Fix typos in InternalDocs/compiler.md (#149915)
files:
M InternalDocs/compiler.md
M Python/symtable.c
diff --git a/InternalDocs/compiler.md b/InternalDocs/compiler.md
index 742af5efcf5ce50..9ed4d0eb65a0bdd 100644
--- a/InternalDocs/compiler.md
+++ b/InternalDocs/compiler.md
@@ -359,19 +359,19 @@ in [Python/compile.c](../Python/compile.c) into a
sequence of pseudo instruction
These are similar to bytecode, but in some cases they are more abstract, and
are
resolved later into actual bytecode. The construction of this instruction
sequence
is handled by several functions that break the task down by various AST node
types.
-The functions are all named `compiler_visit_{xx}` where *xx* is the name of
the node
+The functions are all named `codegen_visit_{xx}` where *xx* is the name of the
node
type (such as `stmt`, `expr`, etc.). Each function receives a `struct
compiler *`
and `{xx}_ty` where *xx* is the AST node type. Typically these functions
consist of a large 'switch' statement, branching based on the kind of
node type passed to it. Simple things are handled inline in the
'switch' statement with more complex transformations farmed out to other
-functions named `compiler_{xx}` with *xx* being a descriptive name of what is
+functions named `codegen_{xx}` with *xx* being a descriptive name of what is
being handled.
When transforming an arbitrary AST node, use the `VISIT()` macro.
-The appropriate `compiler_visit_{xx}` function is called, based on the value
+The appropriate `codegen_visit_{xx}` function is called, based on the value
passed in for <node type> (so `VISIT({c}, expr, {node})` calls
-`compiler_visit_expr({c}, {node})`). The `VISIT_SEQ()` macro is very similar,
+`codegen_visit_expr({c}, {node})`). The `VISIT_SEQ()` macro is very similar,
but is called on AST node sequences (those values that were created as
arguments to a node that used the '*' modifier).
@@ -414,8 +414,8 @@ which is added at the end of a function is not associated
with any
line in the source code.
There are several helper functions that will emit pseudo-instructions
-and are named `compiler_{xx}()` where *xx* is what the function helps
-with (`list`, `boolop`, etc.). A rather useful one is `compiler_nameop()`.
+and are named `codegen_{xx}()` where *xx* is what the function helps
+with (`list`, `boolop`, etc.). A rather useful one is `codegen_nameop()`.
This function looks up the scope of a variable and, based on the
expression context, emits the proper opcode to load, store, or delete
the variable.
diff --git a/Python/symtable.c b/Python/symtable.c
index 2263a2d8db9097d..14d7ce91b628354 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1708,7 +1708,7 @@ symtable_enter_type_param_block(struct symtable *st,
identifier name,
return 1;
}
-/* VISIT, VISIT_SEQ and VIST_SEQ_TAIL take an ASDL type as their second
argument.
+/* VISIT, VISIT_SEQ and VISIT_SEQ_TAIL take an ASDL type as their second
argument.
They use the ASDL name to synthesize the name of the C type and the visit
function.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]