mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Fix typos in the Objects directory (GH-28766)
This commit is contained in:
parent
db72e58ea5
commit
5f401f1040
11 changed files with 14 additions and 14 deletions
|
@ -105,7 +105,7 @@ All offsets and lengths are in instructions, not bytes.
|
||||||
We want the format to be compact, but quickly searchable.
|
We want the format to be compact, but quickly searchable.
|
||||||
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.
|
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.
|
||||||
For it to be searchable quickly, we need to support binary search giving us log(n) performance in all cases.
|
For it to be searchable quickly, we need to support binary search giving us log(n) performance in all cases.
|
||||||
Binary search typically assumes fixed size entries, but that is not necesary, as long as we can identify the start of an entry.
|
Binary search typically assumes fixed size entries, but that is not necessary, as long as we can identify the start of an entry.
|
||||||
|
|
||||||
It is worth noting that the size (end-start) is always smaller than the end, so we encode the entries as:
|
It is worth noting that the size (end-start) is always smaller than the end, so we encode the entries as:
|
||||||
start, size, target, depth, push-lasti
|
start, size, target, depth, push-lasti
|
||||||
|
|
|
@ -90,7 +90,7 @@ static void
|
||||||
BaseException_dealloc(PyBaseExceptionObject *self)
|
BaseException_dealloc(PyBaseExceptionObject *self)
|
||||||
{
|
{
|
||||||
PyObject_GC_UnTrack(self);
|
PyObject_GC_UnTrack(self);
|
||||||
// bpo-44348: The trashcan mecanism prevents stack overflow when deleting
|
// bpo-44348: The trashcan mechanism prevents stack overflow when deleting
|
||||||
// long chains of exceptions. For example, exceptions can be chained
|
// long chains of exceptions. For example, exceptions can be chained
|
||||||
// through the __context__ attributes or the __traceback__ attribute.
|
// through the __context__ attributes or the __traceback__ attribute.
|
||||||
Py_TRASHCAN_BEGIN(self, BaseException_dealloc)
|
Py_TRASHCAN_BEGIN(self, BaseException_dealloc)
|
||||||
|
|
|
@ -2350,7 +2350,7 @@ _PyFloat_Pack8(double x, unsigned char *p, int le)
|
||||||
flo = 0;
|
flo = 0;
|
||||||
++fhi;
|
++fhi;
|
||||||
if (fhi >> 28) {
|
if (fhi >> 28) {
|
||||||
/* And it also progagated out of the next 28 bits. */
|
/* And it also propagated out of the next 28 bits. */
|
||||||
fhi = 0;
|
fhi = 0;
|
||||||
++e;
|
++e;
|
||||||
if (e >= 2047)
|
if (e >= 2047)
|
||||||
|
|
|
@ -408,7 +408,7 @@ frame_stack_pop(PyFrameObject *f)
|
||||||
* would still work without any stack errors), but there are some constructs
|
* would still work without any stack errors), but there are some constructs
|
||||||
* that limit jumping:
|
* that limit jumping:
|
||||||
*
|
*
|
||||||
* o Any excpetion handlers.
|
* o Any exception handlers.
|
||||||
* o 'for' and 'async for' loops can't be jumped into because the
|
* o 'for' and 'async for' loops can't be jumped into because the
|
||||||
* iterator needs to be on the stack.
|
* iterator needs to be on the stack.
|
||||||
* o Jumps cannot be made from within a trace function invoked with a
|
* o Jumps cannot be made from within a trace function invoked with a
|
||||||
|
|
|
@ -1973,7 +1973,7 @@ powerloop(Py_ssize_t s1, Py_ssize_t n1, Py_ssize_t n2, Py_ssize_t n)
|
||||||
* and merge adjacent runs on the stack with greater power. See listsort.txt
|
* and merge adjacent runs on the stack with greater power. See listsort.txt
|
||||||
* for more info.
|
* for more info.
|
||||||
*
|
*
|
||||||
* It's the caller's responsibilty to push the new run on the stack when this
|
* It's the caller's responsibility to push the new run on the stack when this
|
||||||
* returns.
|
* returns.
|
||||||
*
|
*
|
||||||
* Returns 0 on success, -1 on error.
|
* Returns 0 on success, -1 on error.
|
||||||
|
@ -2067,7 +2067,7 @@ safe_object_compare(PyObject *v, PyObject *w, MergeState *ms)
|
||||||
return PyObject_RichCompareBool(v, w, Py_LT);
|
return PyObject_RichCompareBool(v, w, Py_LT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Homogeneous compare: safe for any two compareable objects of the same type.
|
/* Homogeneous compare: safe for any two comparable objects of the same type.
|
||||||
* (ms->key_richcompare is set to ob_type->tp_richcompare in the
|
* (ms->key_richcompare is set to ob_type->tp_richcompare in the
|
||||||
* pre-sort check.)
|
* pre-sort check.)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -382,7 +382,7 @@ things we don't have:
|
||||||
extension on most platforms, but not all, and there's no uniform spelling
|
extension on most platforms, but not all, and there's no uniform spelling
|
||||||
on the platforms that support it.
|
on the platforms that support it.
|
||||||
|
|
||||||
- Integer divison on an integer type twice as wide as needed to hold the
|
- Integer division on an integer type twice as wide as needed to hold the
|
||||||
list length. But the latter is Py_ssize_t for us, and is typically the
|
list length. But the latter is Py_ssize_t for us, and is typically the
|
||||||
widest native signed integer type the platform supports.
|
widest native signed integer type the platform supports.
|
||||||
|
|
||||||
|
@ -797,6 +797,6 @@ OPTIMIZATION OF INDIVIDUAL COMPARISONS
|
||||||
As noted above, even the simplest Python comparison triggers a large pile of
|
As noted above, even the simplest Python comparison triggers a large pile of
|
||||||
C-level pointer dereferences, conditionals, and function calls. This can be
|
C-level pointer dereferences, conditionals, and function calls. This can be
|
||||||
partially mitigated by pre-scanning the data to determine whether the data is
|
partially mitigated by pre-scanning the data to determine whether the data is
|
||||||
homogenous with respect to type. If so, it is sometimes possible to
|
homogeneous with respect to type. If so, it is sometimes possible to
|
||||||
substitute faster type-specific comparisons for the slower, generic
|
substitute faster type-specific comparisons for the slower, generic
|
||||||
PyObject_RichCompareBool.
|
PyObject_RichCompareBool.
|
||||||
|
|
|
@ -848,7 +848,7 @@ static int running_on_valgrind = -1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Alignment of addresses returned to the user. 8-bytes alignment works
|
* Alignment of addresses returned to the user. 8-bytes alignment works
|
||||||
* on most current architectures (with 32-bit or 64-bit address busses).
|
* on most current architectures (with 32-bit or 64-bit address buses).
|
||||||
* The alignment value is also used for grouping small requests in size
|
* The alignment value is also used for grouping small requests in size
|
||||||
* classes spaced ALIGNMENT bytes apart.
|
* classes spaced ALIGNMENT bytes apart.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1409,7 +1409,7 @@ set_difference_update_internal(PySetObject *so, PyObject *other)
|
||||||
|
|
||||||
/* Optimization: When the other set is more than 8 times
|
/* Optimization: When the other set is more than 8 times
|
||||||
larger than the base set, replace the other set with
|
larger than the base set, replace the other set with
|
||||||
interesection of the two sets.
|
intersection of the two sets.
|
||||||
*/
|
*/
|
||||||
if ((PySet_GET_SIZE(other) >> 3) > PySet_GET_SIZE(so)) {
|
if ((PySet_GET_SIZE(other) >> 3) > PySet_GET_SIZE(so)) {
|
||||||
other = set_intersection(so, other);
|
other = set_intersection(so, other);
|
||||||
|
|
|
@ -7349,7 +7349,7 @@ PyUnicode_AsASCIIString(PyObject *unicode)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* INT_MAX is the theoretical largest chunk (or INT_MAX / 2 when
|
/* INT_MAX is the theoretical largest chunk (or INT_MAX / 2 when
|
||||||
transcoding from UTF-16), but INT_MAX / 4 perfoms better in
|
transcoding from UTF-16), but INT_MAX / 4 performs better in
|
||||||
both cases also and avoids partial characters overrunning the
|
both cases also and avoids partial characters overrunning the
|
||||||
length limit in MultiByteToWideChar on Windows */
|
length limit in MultiByteToWideChar on Windows */
|
||||||
#define DECODING_CHUNK_SIZE (INT_MAX/4)
|
#define DECODING_CHUNK_SIZE (INT_MAX/4)
|
||||||
|
@ -15876,7 +15876,7 @@ init_fs_codec(PyInterpreterState *interp)
|
||||||
_Py_error_handler error_handler;
|
_Py_error_handler error_handler;
|
||||||
error_handler = get_error_handler_wide(config->filesystem_errors);
|
error_handler = get_error_handler_wide(config->filesystem_errors);
|
||||||
if (error_handler == _Py_ERROR_UNKNOWN) {
|
if (error_handler == _Py_ERROR_UNKNOWN) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "unknow filesystem error handler");
|
PyErr_SetString(PyExc_RuntimeError, "unknown filesystem error handler");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@ extern const char *PyWin_DLLVersionString;
|
||||||
Returns NULL, or a pointer that should be freed.
|
Returns NULL, or a pointer that should be freed.
|
||||||
|
|
||||||
XXX - this code is pretty strange, as it used to also
|
XXX - this code is pretty strange, as it used to also
|
||||||
work on Win16, where the buffer sizes werent available
|
work on Win16, where the buffer sizes were not available
|
||||||
in advance. It could be simplied now Win16/Win32s is dead!
|
in advance. It could be simplied now Win16/Win32s is dead!
|
||||||
*/
|
*/
|
||||||
static wchar_t *
|
static wchar_t *
|
||||||
|
|
|
@ -23,7 +23,7 @@ enum interactive_underflow_t {
|
||||||
/* Normal mode of operation: return a new token when asked in interactie mode */
|
/* Normal mode of operation: return a new token when asked in interactie mode */
|
||||||
IUNDERFLOW_NORMAL,
|
IUNDERFLOW_NORMAL,
|
||||||
/* Forcefully return ENDMARKER when asked for a new token in interactive mode. This
|
/* Forcefully return ENDMARKER when asked for a new token in interactive mode. This
|
||||||
* can be used to prevent the tokenizer to promt the user for new tokens */
|
* can be used to prevent the tokenizer to prompt the user for new tokens */
|
||||||
IUNDERFLOW_STOP,
|
IUNDERFLOW_STOP,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue