8000 Catch up with main · python/cpython@581036e · GitHub
[go: up one dir, main page]

Skip to content

Commit 581036e

Browse files
committed
Catch up with main
2 parents 4d3e207 + f7c05d7 commit 581036e

File tree

89 files changed

+2606
-1230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2606
-1230
lines changed

.github/CODEOWNERS

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@ Tools/c-analyzer/ @ericsnowcurrently
4545
# dbm
4646
**/*dbm* @corona10 @erlend-aasland @serhiy-storchaka
4747

48+
# runtime state/lifecycle
49+
**/*pylifecycle* @ericsnowcurrently
50+
**/*pystate* @ericsnowcurrently
51+
**/*preconfig* @ericsnowcurrently
52+
**/*initconfig* @ericsnowcurrently
53+
**/*pathconfig* @ericsnowcurrently
54+
**/*sysmodule* @ericsnowcurrently
55+
**/*bltinmodule* @ericsnowcurrently
56+
**/*gil* @ericsnowcurrently
57+
Include/internal/pycore_runtime.h @ericsnowcurrently
58+
Include/internal/pycore_interp.h @ericsnowcurrently
59+
Include/internal/pycore_tstate.h @ericsnowcurrently
60+
Include/internal/pycore_*_state.h @ericsnowcurrently
61+
Include/internal/pycore_*_init.h @ericsnowcurrently
62+
Include/internal/pycore_atexit.h @ericsnowcurrently
63+
Include/internal/pycore_freelist.h @ericsnowcurrently
64+
Include/internal/pycore_global_objects.h @ericsnowcurrently
65+
Include/internal/pycore_obmalloc.h @ericsnowcurrently
66+
Include/internal/pycore_pymem.h @ericsnowcurrently
67+
Modules/main.c @ericsnowcurrently
68+
Programs/_bootstrap_python.c @ericsnowcurrently
69+
Programs/python.c @ericsnowcurrently
70+
Tools/build/generate_global_objects.py @ericsnowcurrently
71+
4872
# Exceptions
4973
Lib/traceback.py @iritkatriel
5074
Lib/test/test_except*.py @iritkatriel
@@ -79,7 +103,20 @@ Modules/_hacl/** @gpshead
79103
# Import (including importlib).
80104
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
81105
/Python/import.c @kumaraditya303
82-
**/*importlib/resources/* @jaraco @warsaw @FFY00
106+
Python/dynload_*.c @ericsnowcurrently
107+
**/*freeze* @ericsnowcurrently
108+
**/*frozen* @ericsnowcurrently
109+
**/*modsupport* @ericsnowcurrently
110+
**/*modulefinder* @ericsnowcurrently
111+
**/*moduleobject* @ericsnowcurrently
112+
**/*multiphase* @ericsnowcurrently
113+
**/*pkgutil* @ericsnowcurrently
114+
**/*pythonrun* @ericsnowcurrently
115+
**/*runpy* @ericsnowcurrently
116+
**/*singlephase* @ericsnowcurrently
117+
Lib/test/test_module/ @ericsnowcurrently
118+
Doc/c-api/module.rst @ericsnowcurrently
119+
**/*importlib/resources/* @jaraco @warsaw @FFY00
83120
**/importlib/metadata/* @jaraco @warsaw
84121

85122
# Dates and times
@@ -198,6 +235,8 @@ Doc/c-api/stable.rst @encukou
198235
Doc/howto/clinic.rst @erlend-aasland
199236

200237
# Subinterpreters
238+
**/*interpreteridobject.* @ericsnowcurrently
239+
**/*crossinterp* @ericsnowcurrently
201240
Lib/test/support/interpreters/ @ericsnowcurrently
202241
Modules/_xx*interp*module.c @ericsnowcurrently
203242
Lib/test/test_interpreters/ @ericsnowcurrently

Doc/c-api/conversion.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,42 @@ The return value (*rv*) for these functions should be interpreted as follows:
4848
4949
The following functions provide locale-independent string to number conversions.
5050
51+
.. c:function:: unsigned long PyOS_strtoul(const char *str, char **ptr, int base)
52+
53+
Convert the initial part of the string in ``str`` to an :c:expr:`unsigned
54+
long` value according to the given ``base``, which must be between ``2`` and
55+
``36`` inclusive, or be the special value ``0``.
56+
57+
Leading white space and case of characters are ignored. If ``base`` is zero
58+
it looks for a leading ``0b``, ``0o`` or ``0x`` to tell which base. If
59+
these are absent it defaults to ``10``. Base must be 0 or between 2 and 36
60+
(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the
61+
end of the scan.
62+
63+
If the converted value falls out of range of corresponding return type,
64+
range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and
65+
:c:macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0``
66+
is returned.
67+
68+
See also the Unix man page :manpage:`strtoul(3)`.
69+
70+
.. versionadded:: 3.2
71+
72+
73+
.. c:function:: long PyOS_strtol(const char *str, char **ptr, int base)
74+
75+
Convert the initial part of the string in ``str`` to an :c:expr:`long` value
76+
according to the given ``base``, which must be between ``2`` and ``36``
77+
inclusive, or be the special value ``0``.
78+
79+
Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead
80+
and :c:macro:`LONG_MAX` on overflows.
81+
82+
See also the Unix man page :manpage:`strtol(3)`.
83+
84+
.. versionadded:: 3.2
85+
86+
5187
.. c:function:: double PyOS_string_to_double(const char *s, char **endptr, PyObject *overflow_exception)
5288
5389
Convert a string ``s`` to a :c:expr:`double`, raising a Python

Doc/c-api/file.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ the :mod:`io` APIs instead.
6565
Overrides the normal behavior of :func:`io.open_code` to pass its parameter
6666
through the provided handler.
6767
68-
The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
69-
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
68+
The *handler* is a function of type:
69+
70+
.. c:namespace:: NULL
71+
.. c:type:: PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *)
72+
73+
Equivalent of :c:expr:`PyObject *(\*)(PyObject *path,
74+
void *userData)`, where *path* is guaranteed to be
75+
:c:type:`PyUnicodeObject`.
7076
7177
The *userData* pointer is passed into the hook function. Since hook
7278
functions may be called from different runtimes, this pointer should not

Doc/c-api/object.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ Object Protocol
1919
to NotImplemented and return it).
2020

2121

22+
.. c:macro:: Py_PRINT_RAW
23+
24+
Flag to be used with multiple functions that print the object (like
25+
:c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`).
26+
If passed, these function would use the :func:`str` of the object
27+
instead of the :func:`repr`.
28+
29+
2230
.. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
2331
2432
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument
@@ -221,12 +229,8 @@ Object Protocol
221229
.. c:function:: int PyObject_RichCompareBool(PyObject *o1, PyObject *o2, int opid)
222230
223231
Compare the values of *o1* and *o2* using the operation specified by *opid*,
224-
which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`,
225-
:c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to ``<``,
226-
``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` on error,
227-
``0`` if the result is false, ``1`` otherwise. This is the equivalent of the
228-
Python expression ``o1 op o2``, where ``op`` is the operator corresponding to
229-
*opid*.
232+
like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if
233+
the result is false, ``1`` otherwise.
230234
231235
.. note::
232236
If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool`

Doc/library/atexit.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
.. module:: atexit
55
:synopsis: Register and execute cleanup functions.
66

7-
.. moduleauthor:: Skip Montanaro <skip@pobox.com>
8-
.. sectionauthor:: Skip Montanaro <skip@pobox.com>
7+
.. moduleauthor:: Skip Montanaro <skip.montanaro@gmail.com>
8+
.. sectionauthor:: Skip Montanaro <skip.montanaro@gmail.com>
99

1010
--------------
1111

Doc/library/csv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.. module:: csv
55
:synopsis: Write and read tabular data to and from delimited files.
66

7-
.. sectionauthor:: Skip Montanaro <skip@pobox.com>
7+
.. sectionauthor:: Skip Montanaro <skip.montanaro@gmail.com>
88

99
**Source code:** :source:`Lib/csv.py`
1010

Doc/library/dataclasses.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Module contents
141141
then :func:`dataclass` *may* add an implicit :meth:`~object.__hash__` method.
142142
Although not recommended, you can force :func:`dataclass` to create a
143143
:meth:`~object.__hash__` method with ``unsafe_hash=True``. This might be the case
144-
if your class is logically immutable but can nonetheless be mutated.
144+
if your class is logically immutable but can still be mutated.
145145
This is a specialized use case and should be considered carefully.
146146

147147
Here are the rules governing implicit creation of a :meth:`~object.__hash__`
@@ -538,8 +538,8 @@ that has to be called, it is common to call this method in a
538538

539539
class Rectangle:
540540
def __init__(self, height, width):
541-
self.height = height
542-
self.width = width
541+
self.height = height
542+
self.width = width
543543

544544
@dataclass
545545
class Square(Rectangle):

0 commit comments

Comments
 (0)
0