diff options
author | Matthias Geier <Matthias.Geier@gmail.com> | 2015-11-01 09:27:35 +0100 |
---|---|---|
committer | Matthias Geier <Matthias.Geier@gmail.com> | 2015-12-11 10:00:31 +0100 |
commit | c5d8f5c9261a887349f46f4a12047a2d0b99d083 (patch) | |
tree | 11eddf73838d97aa44648765c280775956bc12a5 /doc/source/reference/arrays.classes.rst | |
parent | 9424d3616d8c80b7f0b4dcf31ff3c335db76c0fa (diff) | |
download | numpy-c5d8f5c9261a887349f46f4a12047a2d0b99d083.tar.gz |
DOC: fix method signatures in "array subclasses"
* Change ".. function::" -> ".. method::"
* Remove "self" argument
* Change "self" to "obj" in __array_finalize__
Diffstat (limited to 'doc/source/reference/arrays.classes.rst')
-rw-r--r-- | doc/source/reference/arrays.classes.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/source/reference/arrays.classes.rst b/doc/source/reference/arrays.classes.rst index 5716f4562..b82f7d33c 100644 --- a/doc/source/reference/arrays.classes.rst +++ b/doc/source/reference/arrays.classes.rst @@ -39,9 +39,9 @@ Special attributes and methods Numpy provides several hooks that classes can customize: -.. function:: class.__numpy_ufunc__(self, ufunc, method, i, inputs, **kwargs) +.. method:: class.__numpy_ufunc__(ufunc, method, i, inputs, **kwargs) - .. versionadded:: 1.10 + .. versionadded:: 1.11 Any class (ndarray subclass or not) can define this method to override behavior of Numpy's ufuncs. This works quite similarly to @@ -109,7 +109,7 @@ Numpy provides several hooks that classes can customize: your_obj)`` always calls only your ``__numpy_ufunc__``, as expected. -.. function:: class.__array_finalize__(self) +.. method:: class.__array_finalize__(obj) This method is called whenever the system internally allocates a new array from *obj*, where *obj* is a subclass (subtype) of the @@ -118,7 +118,7 @@ Numpy provides several hooks that classes can customize: to update meta-information from the "parent." Subclasses inherit a default implementation of this method that does nothing. -.. function:: class.__array_prepare__(array, context=None) +.. method:: class.__array_prepare__(array, context=None) At the beginning of every :ref:`ufunc <ufuncs.output-type>`, this method is called on the input object with the highest array @@ -130,7 +130,7 @@ Numpy provides several hooks that classes can customize: the subclass and update metadata before returning the array to the ufunc for computation. -.. function:: class.__array_wrap__(array, context=None) +.. method:: class.__array_wrap__(array, context=None) At the end of every :ref:`ufunc <ufuncs.output-type>`, this method is called on the input object with the highest array priority, or @@ -149,7 +149,7 @@ Numpy provides several hooks that classes can customize: possibility for the Python type of the returned object. Subclasses inherit a default value of 0.0 for this attribute. -.. function:: class.__array__([dtype]) +.. method:: class.__array__([dtype]) If a class (ndarray subclass or not) having the :func:`__array__` method is used as the output object of an :ref:`ufunc |