[Python-checkins] r64135 - python/trunk/Doc/library/ctypes.rst
thomas.heller
python-checkins at python.org
Wed Jun 11 20:10:44 CEST 2008
Author: thomas.heller
Date: Wed Jun 11 20:10:43 2008
New Revision: 64135
Log:
More doc fixes.
Modified:
python/trunk/Doc/library/ctypes.rst
Modified: python/trunk/Doc/library/ctypes.rst
==============================================================================
--- python/trunk/Doc/library/ctypes.rst (original)
+++ python/trunk/Doc/library/ctypes.rst Wed Jun 11 20:10:43 2008
@@ -721,6 +721,8 @@
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 @@
>>>
``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 @@
>>> 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 @@
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 @@
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
More information about the Python-checkins
mailing list