Re: [Numpy-discussion] add .H attribute?

2013-07-22 Thread Toder, Evgeny
What if .H is not an attribute, but a method? Is this enough of a warning about copying? Eugene -Original Message- From: numpy-discussion-boun...@scipy.org [mailto:numpy-discussion-boun...@scipy.org] On Behalf Of Nathaniel Smith Sent: Monday, July 22, 2013 3:11 PM To: Discussion of Nume

Re: [Numpy-discussion] What's the difference between calling __mul__ and *?

2013-06-07 Thread Toder, Evgeny
That's how it works in python: """ Note: If the right operand's type is a subclass of the left operand's type and that subclass provides the reflected method for the operation, this method will be called before the left operand's non-reflected method. This behavior allows subclasses to override

Re: [Numpy-discussion] Integer overflow in test_einsum (1.7.1)

2013-05-14 Thread Toder, Evgeny
: [Numpy-discussion] Integer overflow in test_einsum (1.7.1) 14.05.2013 21:52, Toder, Evgeny kirjoitti: > So, does numpy implement modular (two's complement) > arithmetic for signed types [clip] Numpy leaves integer arithmetic to the C compiler. Python and its C modules however by defa

Re: [Numpy-discussion] Integer overflow in test_einsum (1.7.1)

2013-05-14 Thread Toder, Evgeny
C only does modular arithmetic for unsigned types. Signed types (like i2 used here, is should be signed short) are not allowed to overflow in C. I.e. not only is the result not guaranteed to be modular, or not guaranteed to be consistent, the behavior of the whole program is not specified if it

[Numpy-discussion] Integer overflow in test_einsum (1.7.1)

2013-05-14 Thread Toder, Evgeny
Hello, One of the test cases in test_einsum causes integer overflow for i2 type. The test goes like this: >>> import numpy as np >>> dtype = 'i2' >>> n = 15 >>> a = np.arange(4*n, dtype=dtype).reshape(4,n) >>> b = np.arange(n*6, dtype=dtype).reshape(n,6) >>> c = np.arange(24, dtype=dtype).reshap