Skip to content

Commit 9e05261

Browse files
authored
Fix typos in documentation and comments (#119763)
1 parent 5a1205b commit 9e05261

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

Python/brc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// thread states within each bucket.
1515
//
1616
// The queueing thread uses the eval breaker mechanism to notify the owning
17-
// thread that it has objects to merge. Additionaly, all queued objects are
17+
// thread that it has objects to merge. Additionally, all queued objects are
1818
// merged during GC.
1919
#include "Python.h"
2020
#include "pycore_object.h" // _Py_ExplicitMergeRefcount
@@ -197,7 +197,7 @@ _Py_brc_after_fork(PyInterpreterState *interp)
197197
{
198198
// Unlock all bucket mutexes. Some of the buckets may be locked because
199199
// locks can be handed off to a parked thread (see lock.c). We don't have
200-
// to worry about consistency here, becuase no thread can be actively
200+
// to worry about consistency here, because no thread can be actively
201201
// modifying a bucket, but it might be paused (not yet woken up) on a
202202
// PyMutex_Lock while holding that lock.
203203
for (Py_ssize_t i = 0; i < _Py_BRC_NUM_BUCKETS; i++) {

Python/ceval.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ initialize_locals(PyThreadState *tstate, PyFunctionObject *func,
14781478
localsplus[total_args] = u;
14791479
}
14801480
else if (argcount > n) {
1481-
/* Too many postional args. Error is reported later */
1481+
/* Too many positional args. Error is reported later */
14821482
for (j = n; j < argcount; j++) {
14831483
Py_DECREF(args[j]);
14841484
}

Python/flowgraph.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2861,7 +2861,7 @@ _PyCfg_OptimizedCfgToInstructionSequence(cfg_builder *g,
28612861
}
28622862

28632863
/* This is used by _PyCompile_Assemble to fill in the jump and exception
2864-
* targets in a synthetic CFG (which is not the ouptut of the builtin compiler).
2864+
* targets in a synthetic CFG (which is not the output of the builtin compiler).
28652865
*/
28662866
int
28672867
_PyCfg_JumpLabelsToTargets(cfg_builder *g)

Python/gc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This implements the reference cycle garbage collector.
2-
// The Python module inteface to the collector is in gcmodule.c.
2+
// The Python module interface to the collector is in gcmodule.c.
33
// See https://devguide.python.org/internals/garbage-collector/
44

55
#include "Python.h"
@@ -1260,7 +1260,7 @@ gc_list_set_space(PyGC_Head *list, int space)
12601260
* the incremental collector must progress through the old
12611261
* space faster than objects are added to the old space.
12621262
*
1263-
* Each young or incremental collection adds a numebr of
1263+
* Each young or incremental collection adds a number of
12641264
* objects, S (for survivors) to the old space, and
12651265
* incremental collectors scan I objects from the old space.
12661266
* I > S must be true. We also want I > S * N to be where

Python/import.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ import_run_extension(PyThreadState *tstate, PyModInitFunction p0,
19611961
*
19621962
* However, for single-phase init the module's init function will
19631963
* create the module, create other objects (and allocate other
1964-
* memory), populate it and its module state, and initialze static
1964+
* memory), populate it and its module state, and initialize static
19651965
* types. Some modules store other objects and data in global C
19661966
* variables and register callbacks with the runtime/stdlib or
19671967
* even external libraries (which is part of why we can't just

Python/optimizer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ PyUnstable_Optimizer_NewCounter(void)
14551455

14561456
/* We use a bloomfilter with k = 6, m = 256
14571457
* The choice of k and the following constants
1458-
* could do with a more rigourous analysis,
1458+
* could do with a more rigorous analysis,
14591459
* but here is a simple analysis:
14601460
*
14611461
* We want to keep the false positive rate low.

Python/vm-state.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ Tier 2 IR entries are all the same size; there is no equivalent to `EXTENDED_ARG
8787

8888
- **opcode**: Sometimes the same as a Tier 1 opcode, sometimes a separate micro opcode. Tier 2 opcodes are 9 bits (as opposed to Tier 1 opcodes, which fit in 8 bits). By convention, Tier 2 opcode names start with `_`.
8989
- **oparg**: The argument. Usually the same as the Tier 1 oparg after expansion of `EXTENDED_ARG` prefixes. Up to 32 bits.
90-
- **operand**: An aditional argument, Typically the value of *one* cache item from the Tier 1 inline cache, up to 64 bits.
90+
- **operand**: An additional argument, Typically the value of *one* cache item from the Tier 1 inline cache, up to 64 bits.

0 commit comments

Comments
 (0)