[Numpy-discussion] Some comments on the draft PEP (Rev 1.8)

Perry Greenfield perry at stsci.edu
Fri Feb 18 08:13:18 EST 2005


On Feb 17, 2005, at 9:51 PM, Colin J. Williams wrote:
>
> One final request.             In the instance constructor, please 
> avoid the use of 'type' as a parameter name if the constructor is 
> implemented in Python.  This hides the builtin type(), which is 
> sometimes useful in debugging or exploring code.
>

It shouldn't be a problem for those using the constructor in their 
code. It is a problem if one is writing a function where one wants to 
use the same parameter name (to retain an identical case) in which case 
one is masking the built-in (and thus it is necessary to alias the 
built-in). If type is not to be used I think an alternative to typecode 
should be available as that would be a misnomer if the underlying type 
is not a character. One possible alternative is "atype". Any other 
suggestions?

Perry





More information about the NumPy-Discussion mailing list