Skip to content

Commit 498888a

Browse files
committed
Merge branch 'master' into soft-deprecate-Py_INFINITY/141004
2 parents 26cab06 + d6c89a2 commit 498888a

File tree

121 files changed

+2682
-555
lines changed

Some content is hidden

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

121 files changed

+2682
-555
lines changed

Apple/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def lib_non_platform_files(dirname, names):
507507
def create_xcframework(platform: str) -> str:
508508
"""Build an XCframework from the component parts for the platform.
509509
510-
:return: The version number of the Python verion that was packaged.
510+
:return: The version number of the Python version that was packaged.
511511
"""
512512
package_path = CROSS_BUILD_DIR / platform
513513
try:

Doc/c-api/dict.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ Dictionary Objects
245245
``len(p)`` on a dictionary.
246246
247247
248+
.. c:function:: Py_ssize_t PyDict_GET_SIZE(PyObject *p)
249+
250+
Similar to :c:func:`PyDict_Size`, but without error checking.
251+
252+
248253
.. c:function:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
249254
250255
Iterate over all key-value pairs in the dictionary *p*. The

Doc/c-api/float.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@ Floating-Point Objects
7878
Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`.
7979
8080
81+
.. c:macro:: Py_RETURN_NAN
82+
83+
Return :data:`math.nan` from a function.
84+
85+
On most platforms, this is equivalent to ``return PyFloat_FromDouble(NAN)``.
86+
87+
88+
.. c:macro:: Py_RETURN_INF(sign)
89+
90+
Return :data:`math.inf` or :data:`-math.inf <math.inf>` from a function,
91+
depending on the sign of *sign*.
92+
93+
On most platforms, this is equivalent to the following::
94+
95+
return PyFloat_FromDouble(copysign(INFINITY, sign));
96+
97+
8198
Pack and Unpack functions
8299
-------------------------
83100

Doc/c-api/function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ There are a few functions specific to Python functions.
200200
runtime behavior depending on optimization decisions, it does not change
201201
the semantics of the Python code being executed.
202202
203-
If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the
203+
If *event* is ``PyFunction_EVENT_DESTROY``, taking a reference in the
204204
callback to the about-to-be-destroyed function will resurrect it, preventing
205205
it from being freed at this time. When the resurrected object is destroyed
206206
later, any watcher callbacks active at that time will be called again.

Doc/c-api/iterator.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,32 @@ sentinel value is returned.
5050
callable object that can be called with no parameters; each call to it should
5151
return the next item in the iteration. When *callable* returns a value equal to
5252
*sentinel*, the iteration will be terminated.
53+
54+
55+
Other Iterator Objects
56+
^^^^^^^^^^^^^^^^^^^^^^
57+
58+
.. c:var:: PyTypeObject PyByteArrayIter_Type
59+
.. c:var:: PyTypeObject PyBytesIter_Type
60+
.. c:var:: PyTypeObject PyListIter_Type
61+
.. c:var:: PyTypeObject PyListRevIter_Type
62+
.. c:var:: PyTypeObject PySetIter_Type
63+
.. c:var:: PyTypeObject PyTupleIter_Type
64+
.. c:var:: PyTypeObject PyRangeIter_Type
65+
.. c:var:: PyTypeObject PyLongRangeIter_Type
66+
.. c:var:: PyTypeObject PyDictIterKey_Type
67+
.. c:var:: PyTypeObject PyDictRevIterKey_Type
68+
.. c:var:: PyTypeObject PyDictIterValue_Type
69+
.. c:var:: PyTypeObject PyDictRevIterValue_Type
70+
.. c:var:: PyTypeObject PyDictIterItem_Type
71+
.. c:var:: PyTypeObject PyDictRevIterItem_Type
72+
73+
Type objects for iterators of various built-in objects.
74+
75+
Do not create instances of these directly; prefer calling
76+
:c:func:`PyObject_GetIter` instead.
77+
78+
Note that there is no guarantee that a given built-in type uses a given iterator
79+
type. For example, iterating over :class:`range` will use one of two iterator
80+
types depending on the size of the range. Other types may start using a
81+
similar scheme in the future, without warning.

Doc/c-api/memoryview.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ A :class:`memoryview` object exposes the C level :ref:`buffer interface
1313
any other object.
1414

1515

16+
.. c:var:: PyTypeObject PyMemoryView_Type
17+
18+
This instance of :c:type:`PyTypeObject` represents the Python memoryview
19+
type. This is the same object as :class:`memoryview` in the Python layer.
20+
21+
1622
.. c:function:: PyObject *PyMemoryView_FromObject(PyObject *obj)
1723
1824
Create a memoryview object from an object that provides the buffer interface.

0 commit comments

Comments
 (0)