[Numpy-discussion] Re: Re-implementation of Python Numerical arrays (Numeric) available for download
Perry Greenfield
perry at stsci.edu
Tue Nov 20 12:29:13 EST 2001
> 6) Should array properties be accessible as public attributes
> instead of through accessor methods?
>
> We don't currently allow public array attributes to make
> the Python code simpler and faster (otherwise we will
> be forced to use __setattr__ and such). This results in
> incompatibilty with previous code that uses such attributes.
>
>
> I prefer the use of public attributes over accessor methods.
>
>
> --
> Paul Barrett, PhD Space Telescope Science Institute
The issue of efficiency may not be a problem with Python 2.2
or later since it provides new mechanisms that avoid the need
to use __setattr__ to solve this problem. (e.g. __slots__,
property, __get__, and __set__). So it becomes more
of an issue of which style people prefer rather than simplicity
and speed of the code.
Perry
More information about the NumPy-Discussion
mailing list