[Python-checkins] r66072 - python/trunk/Doc/library/ctypes.rst
andrew.kuchling
python-checkins at python.org
Sat Aug 30 17:21:23 CEST 2008
Author: andrew.kuchling
Date: Sat Aug 30 17:21:23 2008
New Revision: 66072
Log:
Tidy up some sentences
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 Sat Aug 30 17:21:23 2008
@@ -10,7 +10,7 @@
.. versionadded:: 2.5
``ctypes`` is a foreign function library for Python. It provides C compatible
-data types, and allows calling functions in dlls/shared libraries. It can be
+data types, and allows calling functions in DLLs or shared libraries. It can be
used to wrap these libraries in pure Python.
@@ -23,8 +23,8 @@
actually work. Since some code samples behave differently under Linux, Windows,
or Mac OS X, they contain doctest directives in comments.
-Note: Some code sample references the ctypes :class:`c_int` type. This type is
-an alias to the :class:`c_long` type on 32-bit systems. So, you should not be
+Note: Some code samples reference the ctypes :class:`c_int` type. This type is
+an alias for the :class:`c_long` type on 32-bit systems. So, you should not be
confused if :class:`c_long` is printed if you would expect :class:`c_int` ---
they are actually the same type.
@@ -34,8 +34,8 @@
Loading dynamic link libraries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``ctypes`` exports the *cdll*, and on Windows also *windll* and *oledll* objects
-to load dynamic link libraries.
+``ctypes`` exports the *cdll*, and on Windows *windll* and *oledll*
+objects, for loading dynamic link libraries.
You load libraries by accessing them as attributes of these objects. *cdll*
loads libraries which export functions using the standard ``cdecl`` calling
@@ -317,7 +317,7 @@
>>> p = create_string_buffer("Hello", 10) # create a 10 byte buffer
>>> print sizeof(p), repr(p.raw)
10 'Hello\x00\x00\x00\x00\x00'
- >>> p.value = "Hi"
+ >>> p.value = "Hi"
>>> print sizeof(p), repr(p.raw)
10 'Hi\x00lo\x00\x00\x00\x00\x00'
>>>
@@ -908,7 +908,7 @@
... p = p.next[0]
...
foo bar foo bar foo bar foo bar
- >>>
+ >>>
.. _ctypes-callback-functions:
@@ -2045,7 +2045,7 @@
.. method:: _CData.from_buffer_copy(source[, offset])
- This method creates a ctypes instance, the buffer is copied from
+ This method creates a ctypes instance, copying the buffer from
the source object buffer which must be readable. The optional
``offset`` parameter specifies an offset into the source buffer
in bytes; the default is zero. If the source buffer is not
@@ -2062,13 +2062,13 @@
.. method:: from_param(obj)
- This method adapts obj to a ctypes type. It is called with the actual
- object used in a foreign function call, when the type is present in the
- foreign functions :attr:`argtypes` tuple; it must return an object that
- can be used as function call parameter.
+ This method adapts *obj* to a ctypes type. It is called with the actual
+ object used in a foreign function call when the type is present in the
+ foreign function's :attr:`argtypes` tuple; it must return an object that
+ can be used as a function call parameter.
- All ctypes data types have a default implementation of this classmethod,
- normally it returns ``obj`` if that is an instance of the type. Some
+ All ctypes data types have a default implementation of this classmethod
+ that normally returns ``obj`` if that is an instance of the type. Some
types accept other objects as well.
More information about the Python-checkins
mailing list