Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6b929580
Commit
6b929580
authored
Jul 14, 2019
by
Michele Angrisano
Committed by
Steve Dower
Jul 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-37571: Add 'b' to prevent the TypeError exception. (GH-14721)
Co-Authored-By:
Kyle Stanley
<
aeros167@gmail.com
>
parent
8efade91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Doc/library/ctypes.rst
Doc/library/ctypes.rst
+8
-3
No files found.
Doc/library/ctypes.rst
View file @
6b929580
...
...
@@ -1178,12 +1178,17 @@ the root-object's underlying buffer.
Another example that may behave different from what one would expect is this::
>>> s = c_char_p()
>>> s.value = "abc def ghi"
>>> s.value =
b
"abc def ghi"
>>> s.value
'abc def ghi'
b
'abc def ghi'
>>> s.value is s.value
False
>>>
>>>
.. note::
Objects instantiated from :class:`c_char_p` can only have their value set to bytes
or integers.
Why is it printing ``False``? ctypes instances are objects containing a memory
block plus some :term:`descriptor`\s accessing the contents of the memory.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment