[Numpy-discussion] Accessors

Magnus Lie Hetland magnus at hetland.org
Tue Jan 29 12:40:04 EST 2002


According to the (probably outdated) user guide for numarray[1]
attributes have accessors such as

  a.foo()     --> get foo
  a.foo(val)  --> set foo to val

but this doesn't seem to be the case. I see that the shape() method
doesn't take any arguments; I guess the reshape method is the thing to
use here. How about other attributes? Will they have special names for
their setters too, or is this only true for the shape attribute? It
seems to me that if we are going to abandon plain Python attributes
(or 2.2 properties), it would be nice to handle the transition in a
consistent manner... Perhaps?

(But then again, I'm sure I'm missing something :)

[1] http://stsdas.stsci.edu/numarray/Userguide.html

--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org




More information about the NumPy-Discussion mailing list