[Numpy-discussion] proposing a "beware of [as]matrix()" warning

josef.pktd@gmai... josef.pktd@gmai...
Wed Apr 28 12:43:21 CDT 2010

On Wed, Apr 28, 2010 at 1:30 PM, David Warde-Farley <dwf@cs.toronto.edu> wrote:
> On 2010-04-28, at 12:05 PM, Travis Oliphant wrote:
>> a(b) is equivalent to dot(a,b)
>> a(b)(c) would be equivalent to dot(dot(a,b),c)
>> This seems rather reasonable.
> Indeed, and it leads to a rather pleasant way of permuting syntax to change the order of operations, i.e. a(b(c)) vs. a(b)(c).

I like the explicit dot method much better, __call__ (parentheses) can
mean anything, and reading the code will be more difficult.
(especially when switching from matlab)


> David
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list