Skip to content
Closed
Changes from all commits
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
10 changes: 9 additions & 1 deletion Include/internal/pycore_abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ _PyIndex_Check(PyObject *obj)
return (tp_as_number != NULL && tp_as_number->nb_index != NULL);
}

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

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.

{
PyMappingMethods *tp_as_mapping = Py_TYPE(obj)->tp_as_mapping;
return (tp_as_mapping != NULL && tp_as_mapping->mp_subscript != NULL);
}

// Exported for external JIT support
PyAPI_FUNC(PyObject *) _PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs);
PyAPI_FUNC(PyObject *) _PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs);
Expand All @@ -40,7 +48,7 @@ PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
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.


/* === Mapping protocol ================================================= */

Expand Down
Loading