We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8efade9 commit 6b92958Copy full SHA for 6b92958
Doc/library/ctypes.rst
@@ -1178,12 +1178,17 @@ the root-object's underlying buffer.
1178
Another example that may behave different from what one would expect is this::
1179
1180
>>> s = c_char_p()
1181
- >>> s.value = "abc def ghi"
+ >>> s.value = b"abc def ghi"
1182
>>> s.value
1183
- 'abc def ghi'
+ b'abc def ghi'
1184
>>> s.value is s.value
1185
False
1186
- >>>
+ >>>
1187
+
1188
+.. note::
1189
1190
+ Objects instantiated from :class:`c_char_p` can only have their value set to bytes
1191
+ or integers.
1192
1193
Why is it printing ``False``? ctypes instances are objects containing a memory
1194
block plus some :term:`descriptor`\s accessing the contents of the memory.
0 commit comments