I have a Vec3D class (see http://pastebin.com/9Y7YbCZq )
I currently enable Vec3D (1,0,0) + 1,2, but I wonder how I should overload the + operator in such a way as to get the following result:
>>> 3.3 + Vec3D(1,0,0) [4.3, 3.3 , 3.3]
No code is required, but just a hint in which direction I should look. Something in common will be more useful than a specific implementation, since I need to implement the same thing for multiplication, subtraction, etc.
python
Arnab datta
source share