Update special methods for buffer interface (PEP 3118 and legacy)
authorLisandro Dalcin <dalcinl@gmail.com>
Mon, 27 Sep 2010 15:30:19 +0000 (12:30 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Mon, 27 Sep 2010 15:30:19 +0000 (12:30 -0300)
src/userguide/special_methods.rst

index 2186ad5d95e3d8702a37b94f5874ee8543fe81b6..01d11f8b20fcb08eb1a01428632ae1aa11e26343 100644 (file)
@@ -322,19 +322,30 @@ Iterators
 | __next__             | self                                  | object      | Get next item (called next in Python)               |
 +-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
 
-Buffer interface  (no Python equivalents - see note 1)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Buffer interface [PEP 3118] (no Python equivalents - see note 1)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 +-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
-| Name                         | Parameters                            | Return type |         Description                                 |
+| Name                  | Parameters                            | Return type |         Description                                 |
++=======================+=======================================+=============+=====================================================+
+| __getbuffer__         | self, Py_buffer `*view`, int flags    |             |                                                     | 
++-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
+| __releasebuffer__     | self, Py_buffer `*view`               |             |                                                     |
++-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
+
+Buffer interface [legacy] (no Python equivalents - see note 1)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
++-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
+| Name                  | Parameters                            | Return type |         Description                                 |
 +=======================+=======================================+=============+=====================================================+
-| __getreadbuffer__    | self, int i, void `**p`               |             |                                                     | 
+| __getreadbuffer__     | self, Py_ssize_t i, void `**p`        |             |                                                     | 
 +-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
-| __getwritebuffer__   | self, int i, void `**p`               |             |                                                     |
+| __getwritebuffer__    | self, Py_ssize_t i, void `**p`        |             |                                                     |
 +-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
-| __getsegcount__      | self, int `*p`                        |             |                                                     |
+| __getsegcount__       | self, Py_ssize_t `*p`                 |             |                                                     |
 +-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
-| __getcharbuffer__    | self, int i, char `**p`               |             |                                                     |
+| __getcharbuffer__     | self, Py_ssize_t i, char `**p`        |             |                                                     |
 +-----------------------+---------------------------------------+-------------+-----------------------------------------------------+
 
 Descriptor objects (see note 2)