Skip to content

Commit 5f401f1

Browse files
authored
Fix typos in the Objects directory (GH-28766)
1 parent db72e58 commit 5f401f1

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

Objects/exception_handling_notes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ All offsets and lengths are in instructions, not bytes.
105105
We want the format to be compact, but quickly searchable.
106106
For it to be compact, it needs to have variable sized entries so that we can store common (small) offsets compactly, but handle large offsets if needed.
107107
For it to be searchable quickly, we need to support binary search giving us log(n) performance in all cases.
108-
Binary search typically assumes fixed size entries, but that is not necesary, as long as we can identify the start of an entry.
108+
Binary search typically assumes fixed size entries, but that is not necessary, as long as we can identify the start of an entry.
109109

110110
It is worth noting that the size (end-start) is always smaller than the end, so we encode the entries as:
111111
start, size, target, depth, push-lasti

Objects/exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void
9090
BaseException_dealloc(PyBaseExceptionObject *self)
9191
{
9292
PyObject_GC_UnTrack(self);
93-
// bpo-44348: The trashcan mecanism prevents stack overflow when deleting
93+
// bpo-44348: The trashcan mechanism prevents stack overflow when deleting
9494
// long chains of exceptions. For example, exceptions can be chained
9595
// through the __context__ attributes or the __traceback__ attribute.
9696
Py_TRASHCAN_BEGIN(self, BaseException_dealloc)

Objects/floatobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2350,7 +2350,7 @@ _PyFloat_Pack8(double x, unsigned char *p, int le)
23502350
flo = 0;
23512351
++fhi;
23522352
if (fhi >> 28) {
2353-
/* And it also progagated out of the next 28 bits. */
2353+
/* And it also propagated out of the next 28 bits. */
23542354
fhi = 0;
23552355
++e;
23562356
if (e >= 2047)

Objects/frameobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ frame_stack_pop(PyFrameObject *f)
408408
* would still work without any stack errors), but there are some constructs
409409
* that limit jumping:
410410
*
411-
* o Any excpetion handlers.
411+
* o Any exception handlers.
412412
* o 'for' and 'async for' loops can't be jumped into because the
413413
* iterator needs to be on the stack.
414414
* o Jumps cannot be made from within a trace function invoked with a

Objects/listobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ powerloop(Py_ssize_t s1, Py_ssize_t n1, Py_ssize_t n2, Py_ssize_t n)
19731973
* and merge adjacent runs on the stack with greater power. See listsort.txt
19741974
* for more info.
19751975
*
1976-
* It's the caller's responsibilty to push the new run on the stack when this
1976+
* It's the caller's responsibility to push the new run on the stack when this
19771977
* returns.
19781978
*
19791979
* Returns 0 on success, -1 on error.
@@ -2067,7 +2067,7 @@ safe_object_compare(PyObject *v, PyObject *w, MergeState *ms)
20672067
return PyObject_RichCompareBool(v, w, Py_LT);
20682068
}
20692069

2070-
/* Homogeneous compare: safe for any two compareable objects of the same type.
2070+
/* Homogeneous compare: safe for any two comparable objects of the same type.
20712071
* (ms->key_richcompare is set to ob_type->tp_richcompare in the
20722072
* pre-sort check.)
20732073
*/

Objects/listsort.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ things we don't have:
382382
extension on most platforms, but not all, and there's no uniform spelling
383383
on the platforms that support it.
384384

385-
- Integer divison on an integer type twice as wide as needed to hold the
385+
- Integer division on an integer type twice as wide as needed to hold the
386386
list length. But the latter is Py_ssize_t for us, and is typically the
387387
widest native signed integer type the platform supports.
388388

@@ -797,6 +797,6 @@ OPTIMIZATION OF INDIVIDUAL COMPARISONS
797797
As noted above, even the simplest Python comparison triggers a large pile of
798798
C-level pointer dereferences, conditionals, and function calls. This can be
799799
partially mitigated by pre-scanning the data to determine whether the data is
800-
homogenous with respect to type. If so, it is sometimes possible to
800+
homogeneous with respect to type. If so, it is sometimes possible to
801801
substitute faster type-specific comparisons for the slower, generic
802802
PyObject_RichCompareBool.

Objects/obmalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ static int running_on_valgrind = -1;
848848

849849
/*
850850
* Alignment of addresses returned to the user. 8-bytes alignment works
851-
* on most current architectures (with 32-bit or 64-bit address busses).
851+
* on most current architectures (with 32-bit or 64-bit address buses).
852852
* The alignment value is also used for grouping small requests in size
853853
* classes spaced ALIGNMENT bytes apart.
854854
*

Objects/setobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ set_difference_update_internal(PySetObject *so, PyObject *other)
14091409

14101410
/* Optimization: When the other set is more than 8 times
14111411
larger than the base set, replace the other set with
1412-
interesection of the two sets.
1412+
intersection of the two sets.
14131413
*/
14141414
if ((PySet_GET_SIZE(other) >> 3) > PySet_GET_SIZE(so)) {
14151415
other = set_intersection(so, other);

Objects/unicodeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7349,7 +7349,7 @@ PyUnicode_AsASCIIString(PyObject *unicode)
73497349
#endif
73507350

73517351
/* INT_MAX is the theoretical largest chunk (or INT_MAX / 2 when
7352-
transcoding from UTF-16), but INT_MAX / 4 perfoms better in
7352+
transcoding from UTF-16), but INT_MAX / 4 performs better in
73537353
both cases also and avoids partial characters overrunning the
73547354
length limit in MultiByteToWideChar on Windows */
73557355
#define DECODING_CHUNK_SIZE (INT_MAX/4)
@@ -15876,7 +15876,7 @@ init_fs_codec(PyInterpreterState *interp)
1587615876
_Py_error_handler error_handler;
1587715877
error_handler = get_error_handler_wide(config->filesystem_errors);
1587815878
if (error_handler == _Py_ERROR_UNKNOWN) {
15879-
PyErr_SetString(PyExc_RuntimeError, "unknow filesystem error handler");
15879+
PyErr_SetString(PyExc_RuntimeError, "unknown filesystem error handler");
1588015880
return -1;
1588115881
}
1588215882

PC/getpathp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ extern const char *PyWin_DLLVersionString;
354354
Returns NULL, or a pointer that should be freed.
355355
356356
XXX - this code is pretty strange, as it used to also
357-
work on Win16, where the buffer sizes werent available
357+
work on Win16, where the buffer sizes were not available
358358
in advance. It could be simplied now Win16/Win32s is dead!
359359
*/
360360
static wchar_t *

Parser/tokenizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ enum interactive_underflow_t {
2323
/* Normal mode of operation: return a new token when asked in interactie mode */
2424
IUNDERFLOW_NORMAL,
2525
/* Forcefully return ENDMARKER when asked for a new token in interactive mode. This
26-
* can be used to prevent the tokenizer to promt the user for new tokens */
26+
* can be used to prevent the tokenizer to prompt the user for new tokens */
2727
IUNDERFLOW_STOP,
2828
};
2929

0 commit comments

Comments
 (0)