Skip to content

gh-157199: Add fast inline _PyMapping_Check to pycore_abstract.h - #157200

Open
denizguney wants to merge 1 commit into
python:mainfrom
denizguney:patch-1
Open

gh-157199: Add fast inline _PyMapping_Check to pycore_abstract.h#157200
denizguney wants to merge 1 commit into
python:mainfrom
denizguney:patch-1

Conversation

@denizguney

@denizguney denizguney commented Sep 8, 2026

Copy link
Copy Markdown

Introduce a fast inlined _PyMapping_Check helper function to optimize internal abstract protocol mapping checks, following the pattern of _PyIndex_Check.

Related to issue #157199.

Introduce a fast inlined _PyMapping_Check helper function to optimize internal abstract protocol mapping checks, following the pattern of _PyIndex_Check.
@python-cla-bot

python-cla-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Sep 8, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

error. */
extern Py_ssize_t _PySequence_IterSearch(PyObject *seq,
PyObject *obj, int operation);
PyObject *obj, int operation);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated change.

Comment on lines +19 to +21
// Fast inlined version of mapping check (Optimized for internal core protocols)
static inline int
_PyMapping_Check(PyObject *obj)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It unused. Hence, addition is useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants