Skip to content

Commit a60ec4c

Browse files
committed
Merge branch 'main' into issue-151039
2 parents 0b55c3c + f051c68 commit a60ec4c

63 files changed

Lines changed: 2714 additions & 274 deletions

File tree

Some content is hidden

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

Doc/c-api/long.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
7171
on failure.
7272
7373
74+
.. c:function:: PyObject* PyLong_FromUnsignedLongLong(unsigned long long v)
75+
76+
Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long long`,
77+
or ``NULL`` on failure.
78+
79+
7480
.. c:function:: PyObject* PyLong_FromInt32(int32_t value)
7581
PyObject* PyLong_FromInt64(int64_t value)
7682
@@ -81,12 +87,6 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
8187
.. versionadded:: 3.14
8288
8389
84-
.. c:function:: PyObject* PyLong_FromUnsignedLongLong(unsigned long long v)
85-
86-
Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long long`,
87-
or ``NULL`` on failure.
88-
89-
9090
.. c:function:: PyObject* PyLong_FromUInt32(uint32_t value)
9191
PyObject* PyLong_FromUInt64(uint64_t value)
9292

Doc/c-api/typeobj.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,13 +2975,13 @@ Buffer Object Structures
29752975
steps:
29762976

29772977
(1) Check if the request can be met. If not, raise :exc:`BufferError`,
2978-
set :c:expr:`view->obj` to ``NULL`` and return ``-1``.
2978+
set ``view->obj`` to ``NULL`` and return ``-1``.
29792979

29802980
(2) Fill in the requested fields.
29812981

29822982
(3) Increment an internal counter for the number of exports.
29832983

2984-
(4) Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`.
2984+
(4) Set ``view->obj`` to *exporter* and increment ``view->obj``.
29852985

29862986
(5) Return ``0``.
29872987

@@ -3007,10 +3007,10 @@ Buffer Object Structures
30073007
schemes can be used:
30083008

30093009
* Re-export: Each member of the tree acts as the exporting object and
3010-
sets :c:expr:`view->obj` to a new reference to itself.
3010+
sets ``view->obj`` to a new reference to itself.
30113011

30123012
* Redirect: The buffer request is redirected to the root object of the
3013-
tree. Here, :c:expr:`view->obj` will be a new reference to the root
3013+
tree. Here, ``view->obj`` will be a new reference to the root
30143014
object.
30153015

30163016
The individual fields of *view* are described in section
@@ -3064,7 +3064,7 @@ Buffer Object Structures
30643064
*view* argument.
30653065

30663066

3067-
This function MUST NOT decrement :c:expr:`view->obj`, since that is
3067+
This function MUST NOT decrement ``view->obj``, since that is
30683068
done automatically in :c:func:`PyBuffer_Release` (this scheme is
30693069
useful for breaking reference cycles).
30703070

Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ first calculation. ::
10421042
>>> functools.reduce(operator.concat, [])
10431043
Traceback (most recent call last):
10441044
...
1045-
TypeError: reduce() of empty sequence with no initial value
1045+
TypeError: reduce() of empty iterable with no initial value
10461046
>>> functools.reduce(operator.mul, [1, 2, 3], 1)
10471047
6
10481048
>>> functools.reduce(operator.mul, [], 1)

Doc/library/bisect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ example uses :py:func:`~bisect.bisect` to look up a letter grade for an exam sco
200200
based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 to 89 is
201201
a 'B', and so on::
202202

203-
>>> def grade(score)
203+
>>> def grade(score):
204204
... i = bisect([60, 70, 80, 90], score)
205205
... return "FDCBA"[i]
206206
...

Doc/library/importlib.resources.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ For all the following functions:
240240

241241
.. versionchanged:: 3.13
242242
Multiple *path_names* are accepted.
243-
*encoding* and *errors* must be given as keyword arguments.
244243

245244

246245
.. function:: is_resource(anchor, *path_names)

Doc/library/logging.handlers.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ timed intervals.
402402
rollover interval.
403403

404404
When computing the next rollover time for the first time (when the handler
405-
is created), the last modification time of an existing log file, or else
405+
is created), the creation time (if supported by the OS and file system)
406+
or the last modification of an existing log file, or else
406407
the current time, is used to compute when the next rotation will occur.
407408

408409
If the *utc* argument is true, times in UTC will be used; otherwise
@@ -449,6 +450,10 @@ timed intervals.
449450
.. versionchanged:: 3.9
450451
The *errors* parameter was added.
451452

453+
.. versionchanged:: next
454+
Use the creation time instead of the last modification time, if supported by the OS and file system.
455+
456+
452457
.. method:: doRollover()
453458

454459
Does a rollover, as described above.

Doc/library/math.rst

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,20 @@ noted otherwise, all return values are floats.
8383

8484
**Trigonometric functions**
8585
--------------------------------------------------------------------------------------------------
86-
:func:`acos(x) <acos>` Arc cosine of *x*
87-
:func:`asin(x) <asin>` Arc sine of *x*
88-
:func:`atan(x) <atan>` Arc tangent of *x*
89-
:func:`atan2(y, x) <atan2>` ``atan(y / x)``
90-
:func:`cos(x) <cos>` Cosine of *x*
91-
:func:`sin(x) <sin>` Sine of *x*
92-
:func:`tan(x) <tan>` Tangent of *x*
86+
:func:`acos(x) <acos>` Arc cosine of *x*, in radians
87+
:func:`acospi(x) <acospi>` Arc cosine of *x*, in half-turns
88+
:func:`asin(x) <asin>` Arc sine of *x*, in radians
89+
:func:`asinpi(x) <asinpi>` Arc sine of *x*, in half-turns
90+
:func:`atan(x) <atan>` Arc tangent of *x*, in radians
91+
:func:`atanpi(x) <atanpi>` Arc tangent of *x*, in half-turns
92+
:func:`atan2(y, x) <atan2>` ``atan(y / x)``, in radians
93+
:func:`atan2pi(y, x) <atan2pi>` ``atan(y / x)``, in half-turns
94+
:func:`cos(x) <cos>` Cosine of *x* radians
95+
:func:`cospi(x) <cospi>` Cosine of *x⋅π* radians
96+
:func:`sin(x) <sin>` Sine of *x* radians
97+
:func:`sinpi(x) <sinpi>` Sine of *x⋅π* radians
98+
:func:`tan(x) <tan>` Tangent of *x* radians
99+
:func:`tanpi(x) <tanpi>` Tangent of *x⋅π* radians
93100

94101
**Hyperbolic functions**
95102
--------------------------------------------------------------------------------------------------
@@ -599,18 +606,42 @@ Trigonometric functions
599606
``pi``.
600607

601608

609+
.. function:: acospi(x)
610+
611+
Return the arc cosine of *x*, in half-turns. The result is between ``0`` and
612+
``1``.
613+
614+
.. versionadded:: next
615+
616+
602617
.. function:: asin(x)
603618

604619
Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and
605620
``pi/2``.
606621

607622

623+
.. function:: asinpi(x)
624+
625+
Return the arc sine of *x*, in half-turns. The result is between ``-0.5`` and
626+
``0.5``.
627+
628+
.. versionadded:: next
629+
630+
608631
.. function:: atan(x)
609632

610633
Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` and
611634
``pi/2``.
612635

613636

637+
.. function:: atanpi(x)
638+
639+
Return the arc tangent of *x*, in half-turns. The result is between ``-0.5`` and
640+
``0.5``.
641+
642+
.. versionadded:: next
643+
644+
614645
.. function:: atan2(y, x)
615646

616647
Return ``atan(y / x)``, in radians. The result is between ``-pi`` and ``pi``.
@@ -621,21 +652,54 @@ Trigonometric functions
621652
-1)`` is ``-3*pi/4``.
622653

623654

655+
.. function:: atan2pi(y, x)
656+
657+
Return ``atanpi(y / x)``, in half-turns. The result is between ``-1`` and ``1``.
658+
The vector in the plane from the origin to point ``(x, y)`` makes this angle
659+
with the positive X axis. The point of :func:`atan2pi` is that the signs of both
660+
inputs are known to it, so it can compute the correct quadrant for the angle.
661+
For example, ``atanpi(1)`` and ``atan2pi(1, 1)`` are both ``0.25``, but
662+
``atan2pi(-1, -1)`` is ``-0.75``.
663+
664+
.. versionadded:: next
665+
666+
624667
.. function:: cos(x)
625668

626669
Return the cosine of *x* radians.
627670

628671

672+
.. function:: cospi(x)
673+
674+
Return the cosine of *x* half-turns (*x⋅π* radians).
675+
676+
.. versionadded:: next
677+
678+
629679
.. function:: sin(x)
630680

631681
Return the sine of *x* radians.
632682

633683

684+
.. function:: sinpi(x)
685+
686+
Return the sine of *x* half-turns (*x⋅π* radians).
687+
688+
.. versionadded:: next
689+
690+
634691
.. function:: tan(x)
635692

636693
Return the tangent of *x* radians.
637694

638695

696+
.. function:: tanpi(x)
697+
698+
Return the tangent of *x* half-turns (*x⋅π* radians).
699+
700+
.. versionadded:: next
701+
702+
639703
Hyperbolic functions
640704
--------------------
641705

Doc/library/operator.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The mathematical and bitwise operations are the most numerous:
110110
.. function:: and_(a, b)
111111
__and__(a, b)
112112

113-
Return the bitwise and of *a* and *b*.
113+
Return ``a & b``.
114114

115115

116116
.. function:: floordiv(a, b)
@@ -134,13 +134,13 @@ The mathematical and bitwise operations are the most numerous:
134134
__inv__(obj)
135135
__invert__(obj)
136136

137-
Return the bitwise inverse of the number *obj*. This is equivalent to ``~obj``.
137+
Return ``~obj``.
138138

139139

140140
.. function:: lshift(a, b)
141141
__lshift__(a, b)
142142

143-
Return *a* shifted left by *b*.
143+
Return ``a << b``.
144144

145145

146146
.. function:: mod(a, b)
@@ -152,7 +152,7 @@ The mathematical and bitwise operations are the most numerous:
152152
.. function:: mul(a, b)
153153
__mul__(a, b)
154154

155-
Return ``a * b``, for *a* and *b* numbers.
155+
Return ``a * b``.
156156

157157

158158
.. function:: matmul(a, b)
@@ -172,25 +172,25 @@ The mathematical and bitwise operations are the most numerous:
172172
.. function:: or_(a, b)
173173
__or__(a, b)
174174

175-
Return the bitwise or of *a* and *b*.
175+
Return ``a | b``.
176176

177177

178178
.. function:: pos(obj)
179179
__pos__(obj)
180180

181-
Return *obj* positive (``+obj``).
181+
Return ``+obj``.
182182

183183

184184
.. function:: pow(a, b)
185185
__pow__(a, b)
186186

187-
Return ``a ** b``, for *a* and *b* numbers.
187+
Return ``a ** b``.
188188

189189

190190
.. function:: rshift(a, b)
191191
__rshift__(a, b)
192192

193-
Return *a* shifted right by *b*.
193+
Return ``a >> b``.
194194

195195

196196
.. function:: sub(a, b)
@@ -209,7 +209,7 @@ The mathematical and bitwise operations are the most numerous:
209209
.. function:: xor(a, b)
210210
__xor__(a, b)
211211

212-
Return the bitwise exclusive or of *a* and *b*.
212+
Return ``a ^ b``.
213213

214214

215215
Operations which work with sequences (some of them with mappings too) include:
@@ -403,13 +403,18 @@ Python syntax and the functions in the :mod:`!operator` module.
403403
+-----------------------+-------------------------+---------------------------------------+
404404
| Division | ``a // b`` | ``floordiv(a, b)`` |
405405
+-----------------------+-------------------------+---------------------------------------+
406-
| Bitwise And | ``a & b`` | ``and_(a, b)`` |
406+
| Bitwise And, or | ``a & b`` | ``and_(a, b)`` |
407+
| Intersection | | |
407408
+-----------------------+-------------------------+---------------------------------------+
408-
| Bitwise Exclusive Or | ``a ^ b`` | ``xor(a, b)`` |
409+
| Bitwise Exclusive Or, | ``a ^ b`` | ``xor(a, b)`` |
410+
| or Symmetric | | |
411+
| Difference | | |
409412
+-----------------------+-------------------------+---------------------------------------+
410-
| Bitwise Inversion | ``~ a`` | ``invert(a)`` |
413+
| Bitwise Inversion, or | ``~ a`` | ``invert(a)`` |
414+
| Complement | | |
411415
+-----------------------+-------------------------+---------------------------------------+
412-
| Bitwise Or | ``a | b`` | ``or_(a, b)`` |
416+
| Bitwise Or, or | ``a | b`` | ``or_(a, b)`` |
417+
| Union | | |
413418
+-----------------------+-------------------------+---------------------------------------+
414419
| Exponentiation | ``a ** b`` | ``pow(a, b)`` |
415420
+-----------------------+-------------------------+---------------------------------------+

0 commit comments

Comments
 (0)