diff -r 09011896374d Doc/library/ctypes.rst --- a/Doc/library/ctypes.rst Sat Sep 15 08:34:47 2012 +0300 +++ b/Doc/library/ctypes.rst Thu Oct 11 20:35:25 2012 +1300 @@ -272,7 +272,7 @@ All these types can be created by calling them with an optional initializer of the correct type and value:: - >>> c_int() + >>> c_long() c_long(0) >>> c_wchar_p("Hello, World") c_wchar_p('Hello, World') @@ -282,7 +282,7 @@ Since these types are mutable, their value can also be changed afterwards:: - >>> i = c_int(42) + >>> i = c_long(42) >>> print(i) c_long(42) >>> print(i.value) @@ -703,7 +703,7 @@ :mod:`ctypes` type:: >>> from ctypes import * - >>> i = c_int(42) + >>> i = c_long(42) >>> pi = pointer(i) >>> @@ -723,10 +723,10 @@ False >>> -Assigning another :class:`c_int` instance to the pointer's contents attribute +Assigning another :class:`c_long` instance to the pointer's contents attribute would cause the pointer to point to the memory location where this is stored:: - >>> i = c_int(99) + >>> i = c_long(99) >>> pi.contents = i >>> pi.contents c_long(99) @@ -761,14 +761,14 @@ :func:`POINTER` function, which accepts any :mod:`ctypes` type, and returns a new type:: - >>> PI = POINTER(c_int) + >>> PI = POINTER(c_long) >>> PI >>> PI(42) Traceback (most recent call last): File "", line 1, in ? TypeError: expected c_long instead of int - >>> PI(c_int(42)) + >>> PI(c_long(42)) >>>