Skip to content

Commit 30d859c

Browse files
ZeroIntensityencukou
authored andcommitted
pythongh-141004: Document C APIs for dictionary keys, values, and items (pythonGH-141009)
(cherry picked from commit f72768f) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent f50989f commit 30d859c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Doc/c-api/dict.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,49 @@ Dictionary Objects
422422
it before returning.
423423
424424
.. versionadded:: 3.12
425+
426+
427+
Dictionary View Objects
428+
^^^^^^^^^^^^^^^^^^^^^^^
429+
430+
.. c:function:: int PyDictViewSet_Check(PyObject *op)
431+
432+
Return true if *op* is a view of a set inside a dictionary. This is currently
433+
equivalent to :c:expr:`PyDictKeys_Check(op) || PyDictItems_Check(op)`. This
434+
function always succeeds.
435+
436+
437+
.. c:var:: PyTypeObject PyDictKeys_Type
438+
439+
Type object for a view of dictionary keys. In Python, this is the type of
440+
the object returned by :meth:`dict.keys`.
441+
442+
443+
.. c:function:: int PyDictKeys_Check(PyObject *op)
444+
445+
Return true if *op* is an instance of a dictionary keys view. This function
446+
always succeeds.
447+
448+
449+
.. c:var:: PyTypeObject PyDictValues_Type
450+
451+
Type object for a view of dictionary values. In Python, this is the type of
452+
the object returned by :meth:`dict.values`.
453+
454+
455+
.. c:function:: int PyDictValues_Check(PyObject *op)
456+
457+
Return true if *op* is an instance of a dictionary values view. This function
458+
always succeeds.
459+
460+
461+
.. c:var:: PyTypeObject PyDictItems_Type
462+
463+
Type object for a view of dictionary items. In Python, this is the type of
464+
the object returned by :meth:`dict.items`.
465+
466+
467+
.. c:function:: int PyDictItems_Check(PyObject *op)
468+
469+
Return true if *op* is an instance of a dictionary items view. This function
470+
always succeeds.

0 commit comments

Comments
 (0)