Skip to content

Commit cf56234

Browse files
committed
Merge branch 'main' into tstrings
2 parents 8842739 + 6430c63 commit cf56234

Some content is hidden

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

50 files changed

+938
-379
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Modules/Setup* @erlend-aasland
3030
Objects/set* @rhettinger
3131
Objects/dict* @methane @markshannon
3232
Objects/typevarobject.c @JelleZijlstra
33+
Objects/unionobject.c @JelleZijlstra
3334
Objects/type* @markshannon
3435
Objects/codeobject.c @markshannon
3536
Objects/frameobject.c @markshannon

.github/zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ rules:
44
dangerous-triggers:
55
ignore:
66
- documentation-links.yml
7+
unpinned-uses:
8+
config:
9+
policies:
10+
"*": ref-pin

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.4
3+
rev: v0.11.6
44
hooks:
55
- id: ruff
66
name: Run Ruff (lint) on Doc/
@@ -24,7 +24,7 @@ repos:
2424
files: ^Doc/
2525

2626
- repo: https://github.com/psf/black-pre-commit-mirror
27-
rev: 24.10.0
27+
rev: 25.1.0
2828
hooks:
2929
- id: black
3030
name: Run Black on Tools/build/check_warnings.py
@@ -49,7 +49,7 @@ repos:
4949
types_or: [c, inc, python, rst]
5050

5151
- repo: https://github.com/python-jsonschema/check-jsonschema
52-
rev: 0.31.0
52+
rev: 0.33.0
5353
hooks:
5454
- id: check-dependabot
5555
- id: check-github-workflows
@@ -61,7 +61,7 @@ repos:
6161
- id: actionlint
6262

6363
- repo: https://github.com/woodruffw/zizmor-pre-commit
64-
rev: v1.1.1
64+
rev: v1.6.0
6565
hooks:
6666
- id: zizmor
6767

Doc/c-api/complex.rst

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -44,36 +44,12 @@ pointers. This is consistent throughout the API.
4444
representation.
4545
4646
47-
.. c:function:: Py_complex _Py_cr_sum(Py_complex left, double right)
48-
49-
Return the sum of a complex number and a real number, using the C :c:type:`Py_complex`
50-
representation.
51-
52-
.. versionadded:: 3.14
53-
54-
5547
.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
5648
5749
Return the difference between two complex numbers, using the C
5850
:c:type:`Py_complex` representation.
5951
6052
61-
.. c:function:: Py_complex _Py_cr_diff(Py_complex left, double right)
62-
63-
Return the difference between a complex number and a real number, using the C
64-
:c:type:`Py_complex` representation.
65-
66-
.. versionadded:: 3.14
67-
68-
69-
.. c:function:: Py_complex _Py_rc_diff(double left, Py_complex right)
70-
71-
Return the difference between a real number and a complex number, using the C
72-
:c:type:`Py_complex` representation.
73-
74-
.. versionadded:: 3.14
75-
76-
7753
.. c:function:: Py_complex _Py_c_neg(Py_complex num)
7854
7955
Return the negation of the complex number *num*, using the C
@@ -86,14 +62,6 @@ pointers. This is consistent throughout the API.
8662
representation.
8763
8864
89-
.. c:function:: Py_complex _Py_cr_prod(Py_complex left, double right)
90-
91-
Return the product of a complex number and a real number, using the C
92-
:c:type:`Py_complex` representation.
93-
94-
.. versionadded:: 3.14
95-
96-
9765
.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
9866
9967
Return the quotient of two complex numbers, using the C :c:type:`Py_complex`
@@ -103,28 +71,6 @@ pointers. This is consistent throughout the API.
10371
:c:data:`errno` to :c:macro:`!EDOM`.
10472
10573
106-
.. c:function:: Py_complex _Py_cr_quot(Py_complex dividend, double divisor)
107-
108-
Return the quotient of a complex number and a real number, using the C
109-
:c:type:`Py_complex` representation.
110-
111-
If *divisor* is zero, this method returns zero and sets
112-
:c:data:`errno` to :c:macro:`!EDOM`.
113-
114-
.. versionadded:: 3.14
115-
116-
117-
.. c:function:: Py_complex _Py_rc_quot(double dividend, Py_complex divisor)
118-
119-
Return the quotient of a real number and a complex number, using the C
120-
:c:type:`Py_complex` representation.
121-
122-
If *divisor* is zero, this method returns zero and sets
123-
:c:data:`errno` to :c:macro:`!EDOM`.
124-
125-
.. versionadded:: 3.14
126-
127-
12874
.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
12975
13076
Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex`

Doc/c-api/unicode.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,17 @@ generic ones are documented for simplicity.
10261026
Generic Codecs
10271027
""""""""""""""
10281028
1029+
The following macro is provided:
1030+
1031+
1032+
.. c:macro:: Py_UNICODE_REPLACEMENT_CHARACTER
1033+
1034+
The Unicode code point ``U+FFFD`` (replacement character).
1035+
1036+
This Unicode character is used as the replacement character during
1037+
decoding if the *errors* argument is set to "replace".
1038+
1039+
10291040
These are the generic codec APIs:
10301041
10311042

Doc/library/multiprocessing.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,25 @@ The :mod:`multiprocessing` package mostly replicates the API of the
670670

671671
.. versionadded:: 3.3
672672

673+
.. method:: interrupt()
674+
675+
Terminate the process. Works on POSIX using the :py:const:`~signal.SIGINT` signal.
676+
Behavior on Windows is undefined.
677+
678+
By default, this terminates the child process by raising :exc:`KeyboardInterrupt`.
679+
This behavior can be altered by setting the respective signal handler in the child
680+
process :func:`signal.signal` for :py:const:`~signal.SIGINT`.
681+
682+
Note: if the child process catches and discards :exc:`KeyboardInterrupt`, the
683+
process will not be terminated.
684+
685+
Note: the default behavior will also set :attr:`exitcode` to ``1`` as if an
686+
uncaught exception was raised in the child process. To have a different
687+
:attr:`exitcode` you may simply catch :exc:`KeyboardInterrupt` and call
688+
``exit(your_code)``.
689+
690+
.. versionadded:: next
691+
673692
.. method:: terminate()
674693

675694
Terminate the process. On POSIX this is done using the :py:const:`~signal.SIGTERM` signal;

Doc/library/socket.rst

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,15 +677,62 @@ Constants
677677
These constants describe the Bluetooth address type when binding or
678678
connecting a :const:`BTPROTO_L2CAP` socket.
679679

680+
.. availability:: Linux, FreeBSD
681+
680682
.. versionadded:: 3.14
681683

684+
.. data:: SOL_RFCOMM
685+
SOL_L2CAP
686+
SOL_HCI
687+
SOL_SCO
688+
SOL_BLUETOOTH
689+
690+
Used in the level argument to the :meth:`~socket.setsockopt` and
691+
:meth:`~socket.getsockopt` methods of Bluetooth socket objects.
692+
693+
:const:`SOL_BLUETOOTH` is only available on Linux. Other constants
694+
are available if the corresponding protocol is supported.
695+
696+
.. data:: SO_L2CAP_*
697+
L2CAP_LM
698+
L2CAP_LM_*
699+
SO_RFCOMM_*
700+
RFCOMM_LM_*
701+
SO_SCO_*
702+
SO_BTH_*
703+
BT_*
704+
705+
Used in the option name and value argument to the :meth:`~socket.setsockopt`
706+
and :meth:`~socket.getsockopt` methods of Bluetooth socket objects.
707+
708+
:const:`!BT_*` and :const:`L2CAP_LM` are only available on Linux.
709+
:const:`!SO_BTH_*` are only available on Windows.
710+
Other constants may be available on Linux and various BSD platforms.
711+
712+
.. versionadded:: next
713+
682714
.. data:: HCI_FILTER
683715
HCI_TIME_STAMP
684716
HCI_DATA_DIR
717+
SO_HCI_EVT_FILTER
718+
SO_HCI_PKT_FILTER
685719

686-
For use with :const:`BTPROTO_HCI`. :const:`!HCI_FILTER` is only
687-
available on Linux and FreeBSD. :const:`!HCI_TIME_STAMP` and
688-
:const:`!HCI_DATA_DIR` are only available on Linux.
720+
Option names for use with :const:`BTPROTO_HCI`.
721+
Availability and format of the option values depend on platform.
722+
723+
.. versionchanged:: next
724+
Added :const:`!SO_HCI_EVT_FILTER` and :const:`!SO_HCI_PKT_FILTER`
725+
on NetBSD and DragonFly BSD.
726+
Added :const:`!HCI_DATA_DIR` on FreeBSD, NetBSD and DragonFly BSD.
727+
728+
.. data:: HCI_DEV_NONE
729+
730+
The ``device_id`` value used to create an HCI socket that isn't specific
731+
to a single Bluetooth adapter.
732+
733+
.. availability:: Linux
734+
735+
.. versionadded:: next
689736

690737
.. data:: HCI_CHANNEL_RAW
691738
HCI_CHANNEL_USER

Doc/whatsnew/3.14.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,10 @@ multiprocessing
10431043
The :func:`set` in :func:`multiprocessing.Manager` method is now available.
10441044
(Contributed by Mingyu Park in :gh:`129949`.)
10451045

1046+
* Add :func:`multiprocessing.Process.interrupt` which terminates the child
1047+
process by sending :py:const:`~signal.SIGINT`. This enables "finally" clauses
1048+
and printing stack trace for the terminated process.
1049+
(Contributed by Artem Pulkin in :gh:`131913`.)
10461050

10471051
operator
10481052
--------
@@ -1159,6 +1163,32 @@ pydoc
11591163
(Contributed by Jelle Zijlstra in :gh:`101552`.)
11601164

11611165

1166+
socket
1167+
------
1168+
1169+
* Improve and fix support for Bluetooth sockets.
1170+
1171+
* Fix support of Bluetooth sockets on NetBSD and DragonFly BSD.
1172+
(Contributed by Serhiy Storchaka in :gh:`132429`.)
1173+
* Fix support for :const:`~socket.BTPROTO_HCI` on FreeBSD.
1174+
(Contributed by Victor Stinner in :gh:`111178`.)
1175+
* Add support for :const:`~socket.BTPROTO_SCO` on FreeBSD.
1176+
(Contributed by Serhiy Storchaka in :gh:`85302`.)
1177+
* Add support for *cid* and *bdaddr_type* in the address for
1178+
:const:`~socket.BTPROTO_L2CAP` on FreeBSD.
1179+
(Contributed by Serhiy Storchaka in :gh:`132429`.)
1180+
* Add support for *channel* in the address for
1181+
:const:`~socket.BTPROTO_HCI` on Linux.
1182+
(Contributed by Serhiy Storchaka in :gh:`70145`.)
1183+
* Accept an integer as the address for
1184+
:const:`~socket.BTPROTO_HCI` on Linux
1185+
(Contributed by Serhiy Storchaka in :gh:`132099`.)
1186+
* Return *cid* in :meth:`~socket.socket.getsockname` for
1187+
:const:`~socket.BTPROTO_L2CAP`.
1188+
(Contributed by Serhiy Storchaka in :gh:`132429`.)
1189+
* Add many new constants.
1190+
(Contributed by Serhiy Storchaka in :gh:`132734`.)
1191+
11621192
ssl
11631193
---
11641194

Include/cpython/complexobject.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@ typedef struct {
99

1010
// Operations on complex numbers.
1111
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
12-
PyAPI_FUNC(Py_complex) _Py_cr_sum(Py_complex, double);
1312
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
14-
PyAPI_FUNC(Py_complex) _Py_cr_diff(Py_complex, double);
15-
PyAPI_FUNC(Py_complex) _Py_rc_diff(double, Py_complex);
1613
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
1714
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
18-
PyAPI_FUNC(Py_complex) _Py_cr_prod(Py_complex, double);
1915
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
20-
PyAPI_FUNC(Py_complex) _Py_cr_quot(Py_complex, double);
21-
PyAPI_FUNC(Py_complex) _Py_rc_quot(double, Py_complex);
2216
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
2317
PyAPI_FUNC(double) _Py_c_abs(Py_complex);
2418

Include/internal/pycore_complexobject.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ extern int _PyComplex_FormatAdvancedWriter(
1919
Py_ssize_t start,
2020
Py_ssize_t end);
2121

22+
// Operations on complex numbers.
23+
PyAPI_FUNC(Py_complex) _Py_cr_sum(Py_complex, double);
24+
PyAPI_FUNC(Py_complex) _Py_cr_diff(Py_complex, double);
25+
PyAPI_FUNC(Py_complex) _Py_rc_diff(double, Py_complex);
26+
PyAPI_FUNC(Py_complex) _Py_cr_prod(Py_complex, double);
27+
PyAPI_FUNC(Py_complex) _Py_cr_quot(Py_complex, double);
28+
PyAPI_FUNC(Py_complex) _Py_rc_quot(double, Py_complex);
29+
30+
2231
#ifdef __cplusplus
2332
}
2433
#endif

0 commit comments

Comments
 (0)