My poor student (with a life sciences background) could not get beyond
In [4]: print 2*Vector3(1,2,3)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 print 2*Vector3(1,2,3)
TypeError: unsupported operand type(s) for *: 'int' and 'Vector3'
when what he felt inclined to achieve worked perfectly fine as
In [3]: print Vector3(1,2,3)*2
(2.000000 4.000000 6.000000)
This was not ultimately surprising with the background of class operators vs external operators, but I admit not to be ultimately firm on this all myself any more (was I ever?). Just, since the int/float*Vector flavour sounds so much more natural, is there something you might want to do about it?
My poor student (with a life sciences background) could not get beyond
when what he felt inclined to achieve worked perfectly fine as
This was not ultimately surprising with the background of class operators vs external operators, but I admit not to be ultimately firm on this all myself any more (was I ever?). Just, since the int/float*Vector flavour sounds so much more natural, is there something you might want to do about it?