Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Include/cpython/critical_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ PyCriticalSection2_End(PyCriticalSection2 *c);
}
#else /* !Py_GIL_DISABLED */

// NOTE: the contents of this struct are private and may change betweeen
// NOTE: the contents of this struct are private and may change between
// Python releases without a deprecation period.
struct PyCriticalSection {
// Tagged pointer to an outer active critical section (or 0).
Expand All @@ -105,7 +105,7 @@ struct PyCriticalSection {

// A critical section protected by two mutexes. Use
// Py_BEGIN_CRITICAL_SECTION2 and Py_END_CRITICAL_SECTION2.
// NOTE: the contents of this struct are private and may change betweeen
// NOTE: the contents of this struct are private and may change between
// Python releases without a deprecation period.
struct PyCriticalSection2 {
PyCriticalSection _cs_base;
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ adaptive_counter_backoff(_Py_BackoffCounter counter) {

/*
* The following bits are chosen so that the value of
* COMPARSION_BIT(left, right)
* COMPARISON_BIT(left, right)
* masked by the values below will be non-zero if the
* comparison is true, and zero if it is false */

Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_critical_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ extern "C" {

// Asserts that the mutex is locked. The mutex must be held by the
// top-most critical section otherwise there's the possibility
// that the mutex would be swalled out in some code paths.
// that the mutex would be stalled out in some code paths.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what swalled is supposed to mean. I can just revert this change and the same one below if you want.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DinoV wrote this.

Refuse the temptation to guess unless you know what it means.

Having said that, my best guess is “swapped out”. The LL and PP keys are in the same corner of my keyboard.

#define _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(mutex) \
_PyCriticalSection_AssertHeld(mutex)

// Asserts that the mutex for the given object is locked. The mutex must
// be held by the top-most critical section otherwise there's the
// possibility that the mutex would be swalled out in some code paths.
// possibility that the mutex would be stalled out in some code paths.
#ifdef Py_DEBUG

# define _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(op) \
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_hamt.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cell in the 7th level of the tree -- so we'd put them in a "collision" node.
Which brings the total possible tree depth to 8. Read more about the actual
layout of the HAMT tree in `hamt.c`.

This constant is used to define a datastucture for storing iteration state.
This constant is used to define a datastructure for storing iteration state.
*/
#define _Py_HAMT_MAX_TREE_DEPTH 8

Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ PyAPI_FUNC(void) _PyRWMutex_Unlock(_PyRWMutex *rwmutex);
// sequence has not changed the data is valid.
//
// Differs a little bit in that we use CAS on sequence as the lock, instead of a separate spin lock.
// The writer can also detect that the undelering data has not changed and abandon the write
// The writer can also detect that the underlying data has not changed and abandon the write
// and restore the previous sequence.
typedef struct {
uint32_t sequence;
Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ extern void _Py_ForgetReference(PyObject *);
PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);

/* We need to maintain an internal copy of Py{Var}Object_HEAD_INIT to avoid
designated initializer conflicts in C++20. If we use the deinition in
designated initializer conflicts in C++20. If we use the definition in
object.h, we will be mixing designated and non-designated initializers in
pycore objects which is forbiddent in C++20. However, if we then use
pycore objects which is forbidden in C++20. However, if we then use
designated initializers in object.h then Extensions without designated break.
Furthermore, we can't use designated initializers in Extensions since these
are not supported pre-C++20. Thus, keeping an internal copy here is the most
Expand Down
2 changes: 1 addition & 1 deletion Include/unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_Split(
Py_ssize_t maxsplit /* Maxsplit count */
);

/* Dito, but split at line breaks.
/* Ditto, but split at line breaks.

CRLF is considered to be one line break. Line breaks are not
included in the resulting list. */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ _pysqlite_build_column_name(pysqlite_Cursor *self, const char *colname)
/*
* Returns a row from the currently active SQLite statement
*
* Precondidition:
* Precondition:
* - sqlite3_step() has been called before and it returned SQLITE_ROW.
*/
static PyObject *
Expand Down
2 changes: 1 addition & 1 deletion Modules/_sre/sre.c
Original file line number Diff line number Diff line change
Expand Up @@ -2989,7 +2989,7 @@ pattern_richcompare(PyObject *lefto, PyObject *righto, int op)
/* Compare the code and the pattern because the same pattern can
produce different codes depending on the locale used to compile the
pattern when the re.LOCALE flag is used. Don't compare groups,
indexgroup nor groupindex: they are derivated from the pattern. */
indexgroup nor groupindex: they are derived from the pattern. */
cmp = (memcmp(left->code, right->code,
sizeof(left->code[0]) * left->codesize) == 0);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testcapi/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ _testcapi_unstable_exc_prep_reraise_star_impl(PyObject *module,


/*
* Define the PyRecurdingInfinitelyError_Type
* Define the PyRecurringInfinitelyError_Type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Define the PyRecurringInfinitelyError_Type
* Define the PyRecursingInfinitelyError type

*/

static PyTypeObject PyRecursingInfinitelyError_Type;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testcapi/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ pymem_api_misuse(PyObject *self, PyObject *args)
char *buffer;

/* Deliberate misusage of Python allocators:
allococate with PyMem but release with PyMem_Raw. */
allocate with PyMem but release with PyMem_Raw. */
buffer = PyMem_Malloc(16);
PyMem_RawFree(buffer);

Expand Down
2 changes: 1 addition & 1 deletion Modules/_testinternalcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2029,7 +2029,7 @@ static PyObject *
gh_119213_getargs_impl(PyObject *module, PyObject *spam)
/*[clinic end generated code: output=d8d9c95d5b446802 input=65ef47511da80fc2]*/
{
// It must never have been called in the main interprer
// It must never have been called in the main interpreter
assert(!_Py_IsMainInterpreter(PyInterpreterState_Get()));
return Py_NewRef(spam);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/_xxtestfuzz/fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static int fuzz_sre_compile(const char* data, size_t size) {
}

/* Some random patterns used to test re.match.
Be careful not to add catostraphically slow regexes here, we want to
Be careful not to add catastrophically slow regexes here, we want to
exercise the matching code without causing timeouts.*/
static const char* regex_patterns[] = {
".", "^", "abc", "abc|def", "^xxx$", "\\b", "()", "[a-zA-Z0-9]",
Expand Down
2 changes: 1 addition & 1 deletion Modules/binascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc)
order from highest-order term to lowest-order term. UARTs transmit
characters in order from LSB to MSB. By storing the CRC this way,
we hand it to the UART in the order low-byte to high-byte; the UART
sends each low-bit to hight-bit; and the result is transmission bit
sends each low-bit to high-bit; and the result is transmission bit
by bit from highest- to lowest-order term without requiring any bit
shuffling on our part. Reception works similarly.

Expand Down
2 changes: 1 addition & 1 deletion Modules/expat/xmlparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3624,7 +3624,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
* has to have passed through the hash table lookup once
* already. That implies that an entry for it already
* exists, so the lookup above will return a pointer to
* already allocated memory. There is no opportunaity for
* already allocated memory. There is no opportunity for
* the allocator to fail, so the condition above cannot be
* fulfilled.
*
Expand Down
2 changes: 1 addition & 1 deletion Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5716,7 +5716,7 @@ os_nice_impl(PyObject *module, int increment)

/* There are two flavours of 'nice': one that returns the new
priority (as required by almost all standards out there) and the
Linux/FreeBSD one, which returns '0' on success and advices
Linux/FreeBSD one, which returns '0' on success and advises
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. advices is perfectly legal.

Copy link
Contributor Author

@ember91 ember91 Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Advices seems to be plural of the noun while advises is the verb. I think this is right.

the use of getpriority() to get the new priority.

If we are of the nice family that returns the new priority, we
Expand Down
2 changes: 1 addition & 1 deletion Objects/mimalloc/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static bool _mi_heap_done(mi_heap_t* heap) {
// free if not the main thread
if (heap != &_mi_heap_main) {
// the following assertion does not always hold for huge segments as those are always treated
// as abondened: one may allocate it in one thread, but deallocate in another in which case
// as abandoned: one may allocate it in one thread, but deallocate in another in which case
// the count can be too large or negative. todo: perhaps not count huge segments? see issue #363
// mi_assert_internal(heap->tld->segments.count == 0 || heap->thread_id != _mi_thread_id());
mi_thread_data_free((mi_thread_data_t*)heap);
Expand Down
2 changes: 1 addition & 1 deletion Objects/mimalloc/prim/windows/prim.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef NTSTATUS (__stdcall *PNtAllocateVirtualMemoryEx)(HANDLE, PVOID*, SIZE_T*
static PVirtualAlloc2 pVirtualAlloc2 = NULL;
static PNtAllocateVirtualMemoryEx pNtAllocateVirtualMemoryEx = NULL;

// Similarly, GetNumaProcesorNodeEx is only supported since Windows 7
// Similarly, GetNumaProcessorNodeEx is only supported since Windows 7
typedef struct MI_PROCESSOR_NUMBER_S { WORD Group; BYTE Number; BYTE Reserved; } MI_PROCESSOR_NUMBER;

typedef VOID (__stdcall *PGetCurrentProcessorNumberEx)(MI_PROCESSOR_NUMBER* ProcNumber);
Expand Down
2 changes: 1 addition & 1 deletion PC/launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ maybe_handle_shebang(wchar_t ** argv, wchar_t * cmdline)
/*
* Found line terminator - parse the shebang.
*
* Strictly, we don't need to handle UTF-16 anf UTF-32,
* Strictly, we don't need to handle UTF-16 and UTF-32,
* since Python itself doesn't.
* Never mind, one day it might.
*/
Expand Down
2 changes: 1 addition & 1 deletion Parser/action_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ _PyPegen_concatenate_strings(Parser *p, asdl_expr_seq *strings,
}
}

/* Drop all empty contanst strings */
/* Drop all empty constant strings */
if (f_string_found &&
PyUnicode_CheckExact(elem->v.Constant.value) &&
PyUnicode_GET_LENGTH(elem->v.Constant.value) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion Parser/pegen_errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ _Pypegen_set_syntax_error(Parser* p, Token* last_token) {
if (p->fill == 0) {
RAISE_SYNTAX_ERROR("error at start before reading any input");
}
// Parser encountered EOF (End of File) unexpectedtly
// Parser encountered EOF (End of File) unexpectedly
if (last_token->type == ERRORTOKEN && p->tok->done == E_EOF) {
if (p->tok->level) {
raise_unclosed_parentheses_error(p);
Expand Down
2 changes: 1 addition & 1 deletion Python/_warnings.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ get_warnings_attr(PyInterpreterState *interp, PyObject *attr, int try_import)
{
PyObject *warnings_module, *obj;

/* don't try to import after the start of the Python finallization */
/* don't try to import after the start of the Python finalization */
if (try_import && !_Py_IsInterpreterFinalizing(interp)) {
warnings_module = PyImport_Import(&_Py_ID(warnings));
if (warnings_module == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ remove_redundant_nops_and_jumps(cfg_builder *g)
The consts object should still be in list form to allow new constants
to be appended.

Code trasnformations that reduce code size initially fill the gaps with
Code transformations that reduce code size initially fill the gaps with
NOPs. Later those NOPs are removed.
*/
static int
Expand Down
2 changes: 1 addition & 1 deletion Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ reload_singlephase_extension(PyThreadState *tstate,
assert(res.err == NULL);
assert(res.kind == _Py_ext_module_kind_SINGLEPHASE);
mod = res.module;
/* Tchnically, the init function could return a different module def.
/* Technically, the init function could return a different module def.
* Then we would probably need to update the global cache.
* However, we don't expect anyone to change the def. */
assert(res.def == def);
Expand Down
6 changes: 3 additions & 3 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ static inline int check_interpreter_whence(long);
For subinterpreters we memcpy() the main interpreter in
PyInterpreterState_New(), leaving it in the same mostly-initialized
state. The only difference is that the interpreter has some
self-referential state that is statically initializexd to the
self-referential state that is statically initialized to the
main interpreter. We fix those fields here, in addition
to the other dynamically initialized fields.
*/
Expand Down Expand Up @@ -1590,7 +1590,7 @@ _PyThreadState_New(PyInterpreterState *interp, int whence)
return new_threadstate(interp, whence);
}

// We keep this for stable ABI compabibility.
// We keep this for stable ABI compatibility.
PyAPI_FUNC(PyThreadState*)
_PyThreadState_Prealloc(PyInterpreterState *interp)
{
Expand Down Expand Up @@ -2963,7 +2963,7 @@ _PyThreadState_CheckConsistency(PyThreadState *tstate)
// called, the GIL does no longer exist.
//
// tstate can be a dangling pointer (point to freed memory): only tstate value
// is used, the pointer is not deferenced.
// is used, the pointer is not dereferenced.
//
// tstate must be non-NULL.
int
Expand Down
Loading