Variable arguments (*args, **kwargs): seeking elegance

John Ladasky john_ladasky at sbcglobal.net
Mon Oct 7 12:42:43 EDT 2013


On Monday, October 7, 2013 9:26:51 AM UTC-7, I wrote:
> Here is one more detail which may be relevant.  The base class for the family of classes I am developing is a numpy.ndarray.  The numpy.ndarray is a C extension type (and if I understand correctly, that means it is immutable by ordinary Python methods).  Subclassing ndarray can get a bit complicated (see http://docs.scipy.org/doc/numpy/user/basics.subclassing.html).

I've just been reading the above page, which is pretty new.  It supersedes a now-defunct page, http://www.scipy.org/Subclasses.  The unusual subclassing needs of an ndarray apparently arise, not from the fact that an ndarray is a C extension type, but because of numpy's special view casting and slicing requirements.  While I don't believe this is highly relevant to the args/kwargs issues I have here, I thought that I should correct my earlier remark.



More information about the Python-list mailing list