Skip to content

Commit 81bcdec

Browse files
committed
Document C APIs for dictionary keys, values, and items.
1 parent 40096da commit 81bcdec

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

Doc/c-api/dict.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,3 +426,85 @@ Dictionary Objects
426426
it before returning.
427427
428428
.. versionadded:: 3.12
429+
430+
431+
.. c:function:: int PyDictViewSet_Check(PyObject *o)
432+
433+
Return true if *o* is a view of a set inside a dictionary. This is
434+
equivalent to :c:expr:`PyDictKeys_Check(o) || PyDictItems_Check(o)`. This
435+
function always succeeds.
436+
437+
438+
Dictionary Keys Objects
439+
^^^^^^^^^^^^^^^^^^^^^^^
440+
441+
.. c:var:: PyTypeObject PyDictKeys_Type
442+
443+
Type object for a view of dictionary keys. In Python, this is the type of
444+
the object returned by :meth:`dict.keys`.
445+
446+
447+
.. c:function:: int PyDictKeys_Check(PyObject *o)
448+
449+
Return true if *o* is an instance of a dictionary keys view. This function
450+
always succeeds.
451+
452+
453+
.. c:var:: PyTypeObject PyDictIterKey_Type
454+
455+
Iterator over the keys of a dictionary.
456+
457+
458+
.. c:var:: PyTypeObject PyDictRevIterKey_Type
459+
460+
Reversed iterator over the keys of a dictionary.
461+
462+
463+
Dictionary Values Objects
464+
^^^^^^^^^^^^^^^^^^^^^^^^^
465+
466+
.. c:var:: PyTypeObject PyDictValues_Type
467+
468+
Type object for a view of dictionary values. In Python, this is the type of
469+
the object returned by :meth:`dict.values`.
470+
471+
472+
.. c:function:: int PyDictValues_Check(PyObject *o)
473+
474+
Return true if *o* is an instance of a dictionary values view. This function
475+
always succeeds.
476+
477+
478+
.. c:var:: PyTypeObject PyDictIterValue_Type
479+
480+
Iterator over the values of a dictionary.
481+
482+
483+
.. c:var:: PyTypeObject PyDictRevIterValue_Type
484+
485+
Reversed iterator over the values of a dictionary.
486+
487+
488+
Dictionary Items Objects
489+
^^^^^^^^^^^^^^^^^^^^^^^^
490+
491+
.. c:var:: PyTypeObject PyDictItems_Type
492+
493+
Type object for a view of dictionary items. In Python, this is the type of
494+
the object returned by :meth:`dict.items`.
495+
496+
497+
.. c:function:: int PyDictItems_Check(PyObject *o)
498+
499+
Return true if *o* is an instance of a dictionary items view. This function
500+
always succeeds.
501+
502+
503+
.. c:var:: PyTypeObject PyDictIterItem_Type
504+
505+
Iterator over the items of a dictionary.
506+
507+
508+
.. c:var:: PyTypeObject PyDictRevIterItem_Type
509+
510+
Reversed iterator over the items of a dictionary.

0 commit comments

Comments
 (0)