FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-141004: Document C APIs for dictionary keys, values, and items by ZeroIntensity · Pull Request #141009 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
46 changes: 46 additions & 0 deletions Doc/c-api/dict.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,49 @@ Dictionary Objects
it before returning.

.. versionadded:: 3.12


Dictionary View Objects
^^^^^^^^^^^^^^^^^^^^^^^

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

Return true if *op* is a view of a set inside a dictionary. This is currently
equivalent to :c:expr:`PyDictKeys_Check(op) || PyDictItems_Check(op)`. This
function always succeeds.


.. 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 *op)

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


.. 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 *op)

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


.. 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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 *op)

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

Back | FazBrowse Home | New Git URL