[Numpy-discussion] add .H attribute?

Alan G Isaac alan.isaac at gmail.com
Tue Jul 23 19:57:39 EDT 2013


On 7/23/2013 6:45 PM, Dag Sverre Seljebotn wrote:
> It'd be great if you could try to incorporate it to create a more balanced overview


Attempt 2:

I believe that propoents of adding a .H attribute have
primarily emphasized

- readability (and general ease of use, including in teaching)
- consistency with matrix and masked array
- forward looking (to a future when .H can be a view)
   in the following sense: it gives access now to
   the conjugate transpose via .H, which is likely
   to be implemented in the future, so as long as
   we document (as with ``diagonal``) that this may
   change, it gives a large chunk of the desired
   benefit now.

The opponents have primarily emphasized

- inconsistency with convention that for arrays
   instance attributes should return views
- NOT forward looking (to a future when .H can be a view)
   in the following sense: it gives access now to
   the conjugate transpose via .H but NOT as a view,
   which is likely to be the preferred implementation
   in the future, and if the implementation changes
   in this preferred way then code that relied on
   behavior rather than documentation will break

Finally, I think (?) everyone (proponents and opponents)
would be happy if .H could provide access to an iterative
view of the conjugate transpose.  (Any objections?)

Better?

Alan






More information about the NumPy-Discussion mailing list