Skip to content

Commit 1789c2d

Browse files
committed
Merge branch 'main' into fix-issue-134759
2 parents e09adad + bd928a3 commit 1789c2d

25 files changed

Lines changed: 364 additions & 131 deletions

Doc/c-api/capsule.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,19 @@ Refer to :ref:`using-capsules` for more information on using these objects.
105105
``module.attribute``. The *name* stored in the capsule must match this
106106
string exactly.
107107
108+
This function splits *name* on the ``.`` character, and imports the first
109+
element. It then processes further elements using attribute lookups.
110+
108111
Return the capsule's internal *pointer* on success. On failure, set an
109112
exception and return ``NULL``.
110113
114+
.. note::
115+
116+
If *name* points to an attribute of some submodule or subpackage, this
117+
submodule or subpackage must be previously imported using other means
118+
(for example, by using :c:func:`PyImport_ImportModule`) for the
119+
attribute lookups to succeed.
120+
111121
.. versionchanged:: 3.3
112122
*no_block* has no effect anymore.
113123

Doc/library/math.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ noted otherwise, all return values are floats.
5959
:func:`isnan(x) <isnan>` Check if *x* is a NaN (not a number)
6060
:func:`ldexp(x, i) <ldexp>` ``x * (2**i)``, inverse of function :func:`frexp`
6161
:func:`nextafter(x, y, steps) <nextafter>` Floating-point value *steps* steps after *x* towards *y*
62+
:func:`signbit(x) <signbit>` Check if *x* is a negative number
6263
:func:`ulp(x) <ulp>` Value of the least significant bit of *x*
6364

6465
**Power, exponential and logarithmic functions**
@@ -431,6 +432,15 @@ Floating point manipulation functions
431432
Added the *steps* argument.
432433

433434

435+
.. function:: signbit(x)
436+
437+
Return ``True`` if the sign of *x* is negative and ``False`` otherwise.
438+
439+
This is useful to detect the sign bit of zeroes, infinities and NaNs.
440+
441+
.. versionadded:: next
442+
443+
434444
.. function:: ulp(x)
435445

436446
Return the value of the least significant bit of the float *x*:

Doc/whatsnew/3.15.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ math
115115
* Add :func:`math.isnormal` and :func:`math.issubnormal` functions.
116116
(Contributed by Sergey B Kirpichev in :gh:`132908`.)
117117

118+
* Add :func:`math.signbit` function.
119+
(Contributed by Bénédikt Tran in :gh:`135853`.)
120+
118121

119122
os.path
120123
-------

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ struct _Py_global_strings {
627627
STRUCT_FOR_ID(offset_src)
628628
STRUCT_FOR_ID(on_type_read)
629629
STRUCT_FOR_ID(onceregistry)
630+
STRUCT_FOR_ID(only_active_thread)
630631
STRUCT_FOR_ID(only_keys)
631632
STRUCT_FOR_ID(oparg)
632633
STRUCT_FOR_ID(opcode)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/idlelib/configdialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def on_fontlist_select(self, event):
435435
self.font_name.set(font.lower())
436436

437437
def set_samples(self, event=None):
438-
"""Update update both screen samples with the font settings.
438+
"""Update both screen samples with the font settings.
439439
440440
Called on font initialization and change events.
441441
Accesses font_name, font_size, and font_bold Variables.

Lib/idlelib/debugger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Debug user code with a GUI interface to a subclass of bdb.Bdb.
22
3-
The Idb idb and Debugger gui instances each need a reference to each
3+
The Idb instance 'idb' and Debugger instance 'gui' need references to each
44
other or to an rpc proxy for each other.
55
66
If IDLE is started with '-n', so that user code and idb both run in the

Lib/idlelib/editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ def tokeneater(self, type, token, start, end, line,
16491649
self.finished = 1
16501650

16511651
def run(self):
1652-
"""Return 2 lines containing block opener and and indent.
1652+
"""Return 2 lines containing block opener and indent.
16531653
16541654
Either the indent line or both may be None.
16551655
"""

0 commit comments

Comments
 (0)