]> granicus.if.org Git - python/commitdiff
bpo-28698: Fix c_wchar_p doc example (GH-1160)
authorLouie Lu <me@louie.lu>
Wed, 26 Apr 2017 08:47:03 +0000 (16:47 +0800)
committerBerker Peksag <berker.peksag@gmail.com>
Wed, 26 Apr 2017 08:47:03 +0000 (11:47 +0300)
(cherry picked from commit 0d637e236d7099f7b724026c8cb7bd83d8e12e6b)

Doc/library/ctypes.rst

index b25fbbb1621f4a73e041c7b07ee5aa872a09346a..3536b32139e71b2bad4ff21b31c316f041ba4289 100644 (file)
@@ -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
    >>>