From 27b459a1a452861541d4b29df58c2c6adcd1c947 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Mon, 27 Sep 2010 12:30:19 -0300 Subject: [PATCH] Update special methods for buffer interface (PEP 3118 and legacy) --- src/userguide/special_methods.rst | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/userguide/special_methods.rst b/src/userguide/special_methods.rst index 2186ad5d..01d11f8b 100644 --- a/src/userguide/special_methods.rst +++ b/src/userguide/special_methods.rst @@ -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) -- 2.26.2