[Numpy-discussion] add .H attribute?

josef.pktd at gmail.com josef.pktd at gmail.com
Tue Jul 23 17:32:52 EDT 2013


On Tue, Jul 23, 2013 at 5:08 PM, Dag Sverre Seljebotn
<d.s.seljebotn at astro.uio.no> wrote:
> On 07/23/2013 07:53 PM, Alan G Isaac wrote:
>> I'm trying to understand the state of this discussion.
>> I believe that propoents of adding a .H attribute have
>> primarily emphasized
>>
>> - readability (and general ease of use)
>> - consistency with matrix and masked array
>> - forward looking (to a future when .H can be a view)
>
> I disagree with this being forward looking, as it explicitly creates a
> situation where code will break if .H becomes a view, e.g.:
>
> xh = x.H
> x *= 2
> assert np.all(2 * xh == x.H)
>
>>
>> The opponents have primarily emphasized
>>
>> - inconsistency with convention that for arrays
>>     instance attributes should return views
>
> I'd formulate this as simply "inconsistency with .T"; they are both
> motivated primarily as notational shorthands.

Do we really need a one letter shorthand for `a.conj().T` ?

I don't.

Josef
(The one who wrote np.max(np.abs(y - x)) and np.max(np.abs(y / x - 1))
30 or more times in the last 24 hours, in pdb.)


>
> Dag Sverre
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion



More information about the NumPy-Discussion mailing list