Feb. 1, 2012
7:26 p.m.
Hi all, here's something I don't understand. Consider the following code snippet: --------------------------------------------------- class A(object): def __radd__(self, other): print(type(other)) import numpy as np np.complex64(1j) + A() --------------------------------------------------- In my world, this should print <type 'numpy.complex64'>. It does print <type 'complex'>. Who is casting my sized complex to a built-in complex, and why? It can be Python's type coercion, because the behavior is the same in Python 3.2. (And the docs say Python 3 doesn't support coercion.) (Please cc me.) Thanks, Andreas