From: Louie Lu Date: Wed, 26 Apr 2017 08:15:05 +0000 (+0800) Subject: bpo-28698: Fix c_wchar_p doc example (GH-1160) X-Git-Tag: v3.7.0a1~901 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d637e236d7099f7b724026c8cb7bd83d8e12e6b;p=python bpo-28698: Fix c_wchar_p doc example (GH-1160) --- diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 4ab8535f0a..49b4cbee5d 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 >>>