@@ -55,6 +55,15 @@ Dictionary Objects
55
55
This is equivalent to the Python expression ``key in p ``.
56
56
57
57
58
+ .. c :function :: int PyDict_ContainsString (PyObject *p, const char *key)
59
+
60
+ This is the same as :c:func: `PyDict_Contains `, but *key * is specified as a
61
+ :c:expr: `const char* ` UTF-8 encoded bytes string, rather than a
62
+ :c:expr: `PyObject* `.
63
+
64
+ .. versionadded :: 3.13
65
+
66
+
58
67
.. c :function :: PyObject* PyDict_Copy (PyObject *p)
59
68
60
69
Return a new dictionary that contains the same key-value pairs as *p *.
@@ -73,7 +82,7 @@ Dictionary Objects
73
82
.. index :: single: PyUnicode_FromString()
74
83
75
84
Insert *val * into the dictionary *p * using *key * as a key. *key * should
76
- be a :c:expr: `const char* `. The key object is created using
85
+ be a :c:expr: `const char* ` UTF-8 encoded bytes string . The key object is created using
77
86
``PyUnicode_FromString(key) ``. Return ``0 `` on success or ``-1 `` on
78
87
failure. This function *does not * steal a reference to *val *.
79
88
@@ -88,7 +97,8 @@ Dictionary Objects
88
97
89
98
.. c :function :: int PyDict_DelItemString (PyObject *p, const char *key)
90
99
91
- Remove the entry in dictionary *p * which has a key specified by the string *key *.
100
+ Remove the entry in dictionary *p * which has a key specified by the UTF-8
101
+ encoded bytes string *key *.
92
102
If *key * is not in the dictionary, :exc: `KeyError ` is raised.
93
103
Return ``0 `` on success or ``-1 `` on failure.
94
104
@@ -136,7 +146,8 @@ Dictionary Objects
136
146
.. c :function :: PyObject* PyDict_GetItemString (PyObject *p, const char *key)
137
147
138
148
This is the same as :c:func: `PyDict_GetItem `, but *key * is specified as a
139
- :c:expr: `const char* `, rather than a :c:expr: `PyObject* `.
149
+ :c:expr: `const char* ` UTF-8 encoded bytes string, rather than a
150
+ :c:expr: `PyObject* `.
140
151
141
152
.. note ::
142
153
@@ -150,7 +161,8 @@ Dictionary Objects
150
161
.. c :function :: int PyDict_GetItemStringRef (PyObject *p, const char *key, PyObject **result)
151
162
152
163
Similar than :c:func: `PyDict_GetItemRef `, but *key * is specified as a
153
- :c:expr: `const char* `, rather than a :c:expr: `PyObject* `.
164
+ :c:expr: `const char* ` UTF-8 encoded bytes string, rather than a
165
+ :c:expr: `PyObject* `.
154
166
155
167
.. versionadded :: 3.13
156
168
0 commit comments