diff options
author | Thomas Heller <theller@ctypes.org> | 2008-06-11 18:10:43 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2008-06-11 18:10:43 (GMT) |
commit | 2e9675adf81bd44ddc29a46f17b8c754d527b12a (patch) | |
tree | ee97626c5ee8014ce19f7f1903496dfff3f32bfa /Doc/library | |
parent | 13f7382e0d4087e5aaa511819e20b5b08405a819 (diff) | |
download | cpython-2e9675adf81bd44ddc29a46f17b8c754d527b12a.zip cpython-2e9675adf81bd44ddc29a46f17b8c754d527b12a.tar.gz cpython-2e9675adf81bd44ddc29a46f17b8c754d527b12a.tar.bz2 |
More doc fixes.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/ctypes.rst | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index df0c96a..e17fd24 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -721,6 +721,8 @@ would cause the pointer to point to the memory location where this is stored:: c_long(99) >>> +.. XXX Document dereferencing pointers, and that it is preferred over the .contents attribute. + Pointer instances can also be indexed with integers:: >>> pi[0] @@ -767,7 +769,7 @@ Calling the pointer type without an argument creates a ``NULL`` pointer. >>> ``ctypes`` checks for ``NULL`` when dereferencing pointers (but dereferencing -non-\ ``NULL`` pointers would crash Python):: +invalid non-\ ``NULL`` pointers would crash Python):: >>> null_ptr[0] Traceback (most recent call last): @@ -813,9 +815,9 @@ To set a POINTER type field to ``NULL``, you can assign ``None``:: >>> bar.values = None >>> -XXX list other conversions... +.. XXX list other conversions... -Sometimes you have instances of incompatible types. In ``C``, you can cast one +Sometimes you have instances of incompatible types. In C, you can cast one type into another type. ``ctypes`` provides a ``cast`` function which can be used in the same way. The ``Bar`` structure defined above accepts ``POINTER(c_int)`` pointers or :class:`c_int` arrays for its ``values`` field, @@ -1072,7 +1074,7 @@ crashing your program when a callback is made. Accessing values exported from dlls ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Sometimes, a dll not only exports functions, it also exports variables. An +Some shared libraries not only export functions, they also export variables. An example in the Python library itself is the ``Py_OptimizeFlag``, an integer set to 0, 1, or 2, depending on the :option:`-O` or :option:`-OO` flag given on startup. @@ -1248,17 +1250,6 @@ dynamic nature of Python, and (re-)define the data type after the required size is already known, on a case by case basis. -.. _ctypes-bugs-todo-non-implemented-things: - -Bugs, ToDo and non-implemented things -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Enumeration types are not implemented. You can do it easily yourself, using -:class:`c_int` as the base class. - -``long double`` is not implemented. - - .. _ctypes-ctypes-reference: ctypes reference |