diff options
Diffstat (limited to 'Doc/library/ctypes.rst')
-rw-r--r-- | Doc/library/ctypes.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 3840935..4ab8535 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1406,8 +1406,10 @@ Instances of these classes have no public methods. Functions exported by the shared library can be accessed as attributes or by index. Please note that accessing the function through an attribute caches the result and therefore accessing it repeatedly returns the same object each time. On the other hand, -accessing it through an index returns a new object each time: +accessing it through an index returns a new object each time:: + >>> from ctypes import CDLL + >>> libc = CDLL("libc.so.6") # On Linux >>> libc.time == libc.time True >>> libc['time'] == libc['time'] |