Skip to content

GH-109975: Copyedit 3.13 What's New: C API #124313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Serhiy pt 2: Group related functions
* PyDict*: PyMapping_GetOptionalItem and PyObject_GetOptionalAttr
* Py_HashPointer and Py_HashPointer
  • Loading branch information
AA-Turner committed Sep 23, 2024
commit 68606744d9b01c5cffaba438b1ab3a756f5d24ba
44 changes: 22 additions & 22 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,26 @@ New Features
and :exc:`KeyError` is not raised for missing keys.
(Contributed by Stefan Behnel and Victor Stinner in :gh:`111262`.)

* Add the :c:func:`PyMapping_GetOptionalItem`
and :c:func:`PyMapping_GetOptionalItemString` functions
as alternatives to :c:func:`PyObject_GetItem`
and :c:func:`PyMapping_GetItemString` respectively.
The new functions do not raise :exc:`KeyError`
if the requested key is missing from the mapping.
These variants are more convenient and faster
if a missing key should not be treated as a failure.
(Contributed by Serhiy Storchaka in :gh:`106307`.)

* Add the :c:func:`PyObject_GetOptionalAttr`
and :c:func:`PyObject_GetOptionalAttrString` functions
as alternatives to :c:func:`PyObject_GetAttr`
and :c:func:`PyObject_GetAttrString` respectively.
The new functions do not raise :exc:`AttributeError`
if the requested attribute is not found on the object.
These variants are more convenient and faster
if the missing attribute should not be treated as a failure.
(Contributed by Serhiy Storchaka in :gh:`106521`.)

* Add the :c:func:`PyErr_FormatUnraisable` function
as an extension to :c:func:`PyErr_WriteUnraisable`
that allows customizing the warning message.
Expand All @@ -2105,9 +2125,6 @@ New Features
to the constant zero.
(Contributed by Victor Stinner in :gh:`115754`.)

* Add the :c:func:`Py_HashPointer` function to hash a raw pointer.
(Contributed by Victor Stinner in :gh:`111545`.)

* Add the :c:func:`PyImport_AddModuleRef` function
as a replacement for :c:func:`PyImport_AddModule`
that returns a :term:`strong reference` instead of a :term:`borrowed reference`.
Expand Down Expand Up @@ -2138,16 +2155,6 @@ New Features
and Python :class:`int` objects.
(Contributed by Steve Dower in :gh:`111140`.)

* Add the :c:func:`PyMapping_GetOptionalItem`
and :c:func:`PyMapping_GetOptionalItemString` functions
as alternatives to :c:func:`PyObject_GetItem`
and :c:func:`PyMapping_GetItemString` respectively.
The new functions do not raise :exc:`KeyError`
if the requested key is missing from the mapping.
These variants are more convenient and faster
if a missing key should not be treated as a failure.
(Contributed by Serhiy Storchaka in :gh:`106307`.)

* Add :c:func:`PyModule_Add` function, which is similar to
:c:func:`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`,
but always steals a reference to the value.
Expand All @@ -2157,15 +2164,8 @@ New Features
that implements the default hashing function of a Python object.
(Contributed by Serhiy Storchaka in :gh:`113024`.)

* Add the :c:func:`PyObject_GetOptionalAttr`
and :c:func:`PyObject_GetOptionalAttrString` functions
as alternatives to :c:func:`PyObject_GetAttr`
and :c:func:`PyObject_GetAttrString` respectively.
The new functions do not raise :exc:`AttributeError`
if the requested attribute is not found on the object.
These variants are more convenient and faster
if the missing attribute should not be treated as a failure.
(Contributed by Serhiy Storchaka in :gh:`106521`.)
* Add the :c:func:`Py_HashPointer` function to hash a raw pointer.
(Contributed by Victor Stinner in :gh:`111545`.)

* Add the :c:func:`PyObject_VisitManagedDict` and
:c:func:`PyObject_ClearManagedDict` functions.
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy