Skip to content
Merged
Changes from 4 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
52 changes: 52 additions & 0 deletions Doc/c-api/dict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,55 @@ Dictionary Objects
it before returning.

.. versionadded:: 3.12


.. c:function:: int PyDictViewSet_Check(PyObject *o)

Return true if *o* is a view of a set inside a dictionary. This is currently
Copy link
Member

Choose a reason for hiding this comment

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

Can we use "op" for the argument as we use it everywhere else for "object pointer"?

Copy link
Member Author

Choose a reason for hiding this comment

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

TIL that's what it stood for, I thought it was "operand". I'll update it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@picnixz picnixz Nov 12, 2025

Choose a reason for hiding this comment

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

FTR there are other occurrences below

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, right. Fixed those too.

equivalent to :c:expr:`PyDictKeys_Check(o) || PyDictItems_Check(o)`. This
function always succeeds.


Dictionary Keys Objects
^^^^^^^^^^^^^^^^^^^^^^^

.. c:var:: PyTypeObject PyDictKeys_Type

Type object for a view of dictionary keys. In Python, this is the type of
the object returned by :meth:`dict.keys`.


.. c:function:: int PyDictKeys_Check(PyObject *o)

Return true if *o* is an instance of a dictionary keys view. This function
always succeeds.


Dictionary Values Objects
^^^^^^^^^^^^^^^^^^^^^^^^^

.. c:var:: PyTypeObject PyDictValues_Type

Type object for a view of dictionary values. In Python, this is the type of
the object returned by :meth:`dict.values`.


.. c:function:: int PyDictValues_Check(PyObject *o)

Return true if *o* is an instance of a dictionary values view. This function
always succeeds.


Dictionary Items Objects
^^^^^^^^^^^^^^^^^^^^^^^^

.. c:var:: PyTypeObject PyDictItems_Type

Type object for a view of dictionary items. In Python, this is the type of
the object returned by :meth:`dict.items`.
Copy link
Member

Choose a reason for hiding this comment

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

Don't we have collections.abc.DictViewSomething? or types.*?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do, but I'm not sure it's worth pointing to it here, because there's no actual correlation between the two types at runtime.



.. c:function:: int PyDictItems_Check(PyObject *o)

Return true if *o* is an instance of a dictionary items view. This function
always succeeds.
Loading