From 6aa2c46129ca2e18aa5e720a9a45f8830f1bfb58 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Wed, 27 Aug 2008 10:09:59 +0000 Subject: Point to example --- numpy/doc/subclassing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/doc') diff --git a/numpy/doc/subclassing.py b/numpy/doc/subclassing.py index fa5f22253..f23cf6652 100644 --- a/numpy/doc/subclassing.py +++ b/numpy/doc/subclassing.py @@ -191,7 +191,7 @@ object. Slightly more realistic example - attribute added to existing array ------------------------------------------------------------------- -Here is a class (with thanks to PierreGM for the original example, +Here is a class (with thanks to Pierre GM for the original example), that takes array that already exists, casts as our type, and adds an extra attribute:: @@ -246,9 +246,9 @@ __array_finalize__, and the attributes will be inherited. By defining a specific __array_wrap__ method for our subclass, we can tweak the output. The __array_wrap__ method requires one argument, the object on which the ufunc is applied, and an optional parameter -context. This parameter is returned by some ufuncs as a 3-element +*context*. This parameter is returned by some ufuncs as a 3-element tuple: (name of the ufunc, argument of the ufunc, domain of the -ufunc). +ufunc). See the masked array subclass for an implementation. Extra gotchas - custom __del__ methods and ndarray.base ------------------------------------------------------- -- cgit v1.2.1