@@ -716,8 +716,8 @@ Pointer instances are created by calling the :func:`pointer` function on a
716716 >>> pi = pointer(i)
717717 >>>
718718
719- Pointer instances have a :attr: `contents ` attribute which returns the object to
720- which the pointer points, the ``i `` object above::
719+ Pointer instances have a :attr: `~_Pointer. contents ` attribute which
720+ returns the object to which the pointer points, the ``i `` object above::
721721
722722 >>> pi.contents
723723 c_long(42)
@@ -2401,6 +2401,56 @@ other data types containing pointer type fields.
24012401Arrays and pointers
24022402^^^^^^^^^^^^^^^^^^^
24032403
2404- Not yet written - please see the sections :ref: `ctypes-pointers ` and section
2405- :ref: `ctypes-arrays ` in the tutorial.
2404+ .. class :: Array(\*args)
2405+
2406+ Abstract base class for arrays.
2407+
2408+ The recommended way to create concrete array types is by multiplying any
2409+ :mod: `ctypes ` data type with a positive integer. Alternatively, you can subclass
2410+ this type and define :attr: `_length_ ` and :attr: `_type_ ` class variables.
2411+ Array elements can be read and written using standard
2412+ subscript and slice accesses; for slice reads, the resulting object is
2413+ *not * itself an :class: `Array `.
2414+
2415+
2416+ .. attribute :: _length_
2417+
2418+ A positive integer specifying the number of elements in the array.
2419+ Out-of-range subscripts result in an :exc: `IndexError `. Will be
2420+ returned by :func: `len `.
2421+
2422+
2423+ .. attribute :: _type_
2424+
2425+ Specifies the type of each element in the array.
2426+
2427+
2428+ Array subclass constructors accept positional arguments, used to
2429+ initialize the elements in order.
2430+
2431+
2432+ .. class :: _Pointer
2433+
2434+ Private, abstract base class for pointers.
2435+
2436+ Concrete pointer types are created by calling :func: `POINTER ` with the
2437+ type that will be pointed to; this is done automatically by
2438+ :func: `pointer `.
2439+
2440+ If a pointer points to an array, its elements can be read and
2441+ written using standard subscript and slice accesses. Pointer objects
2442+ have no size, so :func: `len ` will raise :exc: `TypeError `. Negative
2443+ subscripts will read from the memory *before * the pointer (as in C), and
2444+ out-of-range subscripts will probably crash with an access violation (if
2445+ you're lucky).
2446+
2447+
2448+ .. attribute :: _type_
2449+
2450+ Specifies the type pointed to.
2451+
2452+ .. attribute :: contents
2453+
2454+ Returns the object to which to pointer points. Assigning to this
2455+ attribute changes the pointer to point to the assigned object.
24062456
0 commit comments