[Numpy-discussion] adding a .M attribute to the array.

Konrad Hinsen hinsen at cnrs-orleans.fr
Wed Mar 6 00:50:04 CST 2002

Travis Oliphant <oliphant.travis at ieee.org> writes:

> I've made this change and am ready to commit the change to the Numeric tree, 
> unless there are strong objections.   I know some people do not like the 
> proliferation of attributes, but in this case the notational convenience it 

At the risk of sounding unconstructively negative, I think this is a
misuse of attributes. For someone used to read standard Python code,
where attributes are, well, attributes, code using this notation is
just weird.

Personally, consistent notation is more important than short notation.
The Pythonesque solution to this problem, in my opinion, is separate
matrix and array objects (which can and should of course share
implementation code) plus explicit constructors to convert between the
two. I am a bit worried that kludges such as fake attributes set
bad precedents for the future.

One of the main reasons why I like Python is its clean syntax and its
simple object model. This kind of notation messes up both of them.

Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-
Rue Charles Sadron                       | Fax:  +33-
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais

More information about the Numpy-discussion mailing list