Skip to content

Commit 0d637e2

Browse files
louisomberkerpeksag
authored andcommitted
bpo-28698: Fix c_wchar_p doc example (GH-1160)
1 parent c6db481 commit 0d637e2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Doc/library/ctypes.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ the correct type and value::
284284
>>> c_int()
285285
c_long(0)
286286
>>> c_wchar_p("Hello, World")
287-
c_wchar_p('Hello, World')
287+
c_wchar_p(140018365411392)
288288
>>> c_ushort(-3)
289289
c_ushort(65533)
290290
>>>
@@ -309,11 +309,15 @@ bytes objects are immutable)::
309309
>>> s = "Hello, World"
310310
>>> c_s = c_wchar_p(s)
311311
>>> print(c_s)
312-
c_wchar_p('Hello, World')
312+
c_wchar_p(139966785747344)
313+
>>> print(c_s.value)
314+
Hello World
313315
>>> c_s.value = "Hi, there"
314-
>>> print(c_s)
315-
c_wchar_p('Hi, there')
316-
>>> print(s) # first object is unchanged
316+
>>> print(c_s) # the memory location has changed
317+
c_wchar_p(139966783348904)
318+
>>> print(c_s.value)
319+
Hi, there
320+
>>> print(s) # first object is unchanged
317321
Hello, World
318322
>>>
319323

0 commit comments

Comments
 (0)