[Numpy-discussion] Dcoument strings for ndarray

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Oct 9 19:39:50 EDT 2005


Colin J. Williams wrote:

>     >>> import scipy.base.multiarray as M
>     >>> M.__class__
>    <type 'module'>
>     >>>
> 
> I am surprised that this name points to a module.

<type 'module'> is NOT a module, it's the type
(or class) to which all modules belong. This is to
be expected if scipy.base.multiarray is itself a
module.

The reason it says <type 'module'> and not
<class 'module'> is because it's a built-in type/class
rather than one defined in Python. But ever since the
type/class unification, there's very little difference
in meaning between the terms 'type' and 'class'.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+




More information about the NumPy-Discussion mailing list