summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorLouie Lu <me@louie.lu>2017-04-26 08:15:05 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2017-04-26 08:15:05 (GMT)
commit0d637e236d7099f7b724026c8cb7bd83d8e12e6b (patch)
tree8813710a85133323fee5bb0b6748ab065fb0ef0c /Doc
parentc6db4811f9ea3aeff0e1fafe1c60a22835ef359e (diff)
downloadcpython-0d637e236d7099f7b724026c8cb7bd83d8e12e6b.zip
cpython-0d637e236d7099f7b724026c8cb7bd83d8e12e6b.tar.gz
cpython-0d637e236d7099f7b724026c8cb7bd83d8e12e6b.tar.bz2
bpo-28698: Fix c_wchar_p doc example (GH-1160)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/ctypes.rst14
1 files changed, 9 insertions, 5 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index 4ab8535..49b4cbe 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -284,7 +284,7 @@ the correct type and value::
>>> c_int()
c_long(0)
>>> c_wchar_p("Hello, World")
- c_wchar_p('Hello, World')
+ c_wchar_p(140018365411392)
>>> c_ushort(-3)
c_ushort(65533)
>>>
@@ -309,11 +309,15 @@ bytes objects are immutable)::
>>> s = "Hello, World"
>>> c_s = c_wchar_p(s)
>>> print(c_s)
- c_wchar_p('Hello, World')
+ c_wchar_p(139966785747344)
+ >>> print(c_s.value)
+ Hello World
>>> c_s.value = "Hi, there"
- >>> print(c_s)
- c_wchar_p('Hi, there')
- >>> print(s) # first object is unchanged
+ >>> print(c_s) # the memory location has changed
+ c_wchar_p(139966783348904)
+ >>> print(c_s.value)
+ Hi, there
+ >>> print(s) # first object is unchanged
Hello, World
>>>