summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Objects
diff options
context:
space:
mode:
authorshadchin <[email protected]>2025-06-13 00:05:26 +0300
committershadchin <[email protected]>2025-06-13 00:35:30 +0300
commit796b9088366b10b4cd42885101fc20c0b5709b07 (patch)
treef287eacb0b95ffd7cabf95b16cafb4788645dc38 /contrib/tools/python3/Objects
parentc72bca862651e507d2ff4980ef7f4ff7267a7227 (diff)
Update Python 3 to 3.12.10
commit_hash:dd2398e159fe1d72ea6b12da52fccc933a41a785
Diffstat (limited to 'contrib/tools/python3/Objects')
-rw-r--r--contrib/tools/python3/Objects/clinic/unicodeobject.c.h7
-rw-r--r--contrib/tools/python3/Objects/codeobject.c4
-rw-r--r--contrib/tools/python3/Objects/frameobject.c3
-rw-r--r--contrib/tools/python3/Objects/unicodectype.c16
-rw-r--r--contrib/tools/python3/Objects/unicodeobject.c7
5 files changed, 15 insertions, 22 deletions
diff --git a/contrib/tools/python3/Objects/clinic/unicodeobject.c.h b/contrib/tools/python3/Objects/clinic/unicodeobject.c.h
index 27cbf9d1543..35818ca5610 100644
--- a/contrib/tools/python3/Objects/clinic/unicodeobject.c.h
+++ b/contrib/tools/python3/Objects/clinic/unicodeobject.c.h
@@ -535,10 +535,9 @@ PyDoc_STRVAR(unicode_isprintable__doc__,
"isprintable($self, /)\n"
"--\n"
"\n"
-"Return True if the string is printable, False otherwise.\n"
+"Return True if all characters in the string are printable, False otherwise.\n"
"\n"
-"A string is printable if all of its characters are considered printable in\n"
-"repr() or if it is empty.");
+"A character is printable if repr() may use it in its output.");
#define UNICODE_ISPRINTABLE_METHODDEF \
{"isprintable", (PyCFunction)unicode_isprintable, METH_NOARGS, unicode_isprintable__doc__},
@@ -1499,4 +1498,4 @@ skip_optional_pos:
exit:
return return_value;
}
-/*[clinic end generated code: output=d8f67f37fdbe21c4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=93e74f838796da10 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Objects/codeobject.c b/contrib/tools/python3/Objects/codeobject.c
index 1681d97613e..49f2f272164 100644
--- a/contrib/tools/python3/Objects/codeobject.c
+++ b/contrib/tools/python3/Objects/codeobject.c
@@ -1,5 +1,3 @@
-#include <stdbool.h>
-
#include "Python.h"
#include "opcode.h"
#include "structmember.h" // PyMemberDef
@@ -11,6 +9,8 @@
#include "pycore_tuple.h" // _PyTuple_ITEMS()
#include "clinic/codeobject.c.h"
+#include <stdbool.h>
+
static PyObject* code_repr(PyCodeObject *co);
static const char *
diff --git a/contrib/tools/python3/Objects/frameobject.c b/contrib/tools/python3/Objects/frameobject.c
index d33c3cde526..44f2726f2cc 100644
--- a/contrib/tools/python3/Objects/frameobject.c
+++ b/contrib/tools/python3/Objects/frameobject.c
@@ -1405,6 +1405,9 @@ _PyFrame_LocalsToFast(_PyInterpreterFrame *frame, int clear)
if (kind & CO_FAST_FREE && !(co->co_flags & CO_OPTIMIZED)) {
continue;
}
+ if (kind & CO_FAST_HIDDEN) {
+ continue;
+ }
PyObject *name = PyTuple_GET_ITEM(co->co_localsplusnames, i);
PyObject *value = PyObject_GetItem(locals, name);
/* We only care about NULLs if clear is true. */
diff --git a/contrib/tools/python3/Objects/unicodectype.c b/contrib/tools/python3/Objects/unicodectype.c
index aa5c5b2a4ad..7cd0dca3d13 100644
--- a/contrib/tools/python3/Objects/unicodectype.c
+++ b/contrib/tools/python3/Objects/unicodectype.c
@@ -142,18 +142,10 @@ int _PyUnicode_IsNumeric(Py_UCS4 ch)
return (ctype->flags & NUMERIC_MASK) != 0;
}
-/* Returns 1 for Unicode characters to be hex-escaped when repr()ed,
- 0 otherwise.
- All characters except those characters defined in the Unicode character
- database as following categories are considered printable.
- * Cc (Other, Control)
- * Cf (Other, Format)
- * Cs (Other, Surrogate)
- * Co (Other, Private Use)
- * Cn (Other, Not Assigned)
- * Zl Separator, Line ('\u2028', LINE SEPARATOR)
- * Zp Separator, Paragraph ('\u2029', PARAGRAPH SEPARATOR)
- * Zs (Separator, Space) other than ASCII space('\x20').
+/* Returns 1 for Unicode characters that repr() may use in its output,
+ and 0 for characters to be hex-escaped.
+
+ See documentation of `str.isprintable` for details.
*/
int _PyUnicode_IsPrintable(Py_UCS4 ch)
{
diff --git a/contrib/tools/python3/Objects/unicodeobject.c b/contrib/tools/python3/Objects/unicodeobject.c
index 8c258666403..05bef67f564 100644
--- a/contrib/tools/python3/Objects/unicodeobject.c
+++ b/contrib/tools/python3/Objects/unicodeobject.c
@@ -11864,15 +11864,14 @@ unicode_isidentifier_impl(PyObject *self)
/*[clinic input]
str.isprintable as unicode_isprintable
-Return True if the string is printable, False otherwise.
+Return True if all characters in the string are printable, False otherwise.
-A string is printable if all of its characters are considered printable in
-repr() or if it is empty.
+A character is printable if repr() may use it in its output.
[clinic start generated code]*/
static PyObject *
unicode_isprintable_impl(PyObject *self)
-/*[clinic end generated code: output=3ab9626cd32dd1a0 input=98a0e1c2c1813209]*/
+/*[clinic end generated code: output=3ab9626cd32dd1a0 input=4e56bcc6b06ca18c]*/
{
Py_ssize_t i, length;
int kind;