-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-141004: Document C APIs for dictionary keys, values, and items #141009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
81bcdec
de6b12f
fcee529
823ace9
2cd976b
66f3faa
a394837
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -426,3 +426,85 @@ 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 | ||
| 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. | ||
|
|
||
|
|
||
| .. c:var:: PyTypeObject PyDictIterKey_Type | ||
|
|
||
| Iterator over the keys of a dictionary. | ||
|
|
||
|
|
||
| .. c:var:: PyTypeObject PyDictRevIterKey_Type | ||
|
|
||
| Reversed iterator over the keys of a dictionary. | ||
|
|
||
|
|
||
ZeroIntensity marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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. | ||
|
|
||
|
|
||
| .. c:var:: PyTypeObject PyDictIterValue_Type | ||
|
|
||
| Iterator over the values of a dictionary. | ||
|
|
||
|
|
||
| .. c:var:: PyTypeObject PyDictRevIterValue_Type | ||
|
|
||
| Reversed iterator over the values of a dictionary. | ||
|
|
||
|
|
||
ZeroIntensity marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we have collections.abc.DictViewSomething? or types.*?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
|
|
||
| .. c:var:: PyTypeObject PyDictIterItem_Type | ||
|
|
||
| Iterator over the items of a dictionary. | ||
|
|
||
|
|
||
| .. c:var:: PyTypeObject PyDictRevIterItem_Type | ||
|
|
||
| Reversed iterator over the items of a dictionary. | ||
ZeroIntensity marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.