[Tutor] __mul__ for different variable types?

2009-10-04 Thread Warren
I'm a little confused on this one. I have a Vector class that I want to be able to multiply by either another vector or by a single float value. How would I implement this in my override of __mul__ within that class? Do you check the variable type with a stack of if isinstance

Re: [Tutor] __mul__ for different variable types?

2009-10-04 Thread Rich Lovely
2009/10/4 Warren war...@wantonhubris.com: I'm a little confused on this one. I have a Vector class that I want to be able to multiply by either another vector or by a single float value.  How would I implement this in my override of __mul__ within that class? Do you check the variable type

Re: [Tutor] __mul__ for different variable types?

2009-10-04 Thread Warren
Awesome, Rich, thanks! - Warren (war...@wantonhubris.com) On Oct 4, 2009, at 5:31 PM, Rich Lovely wrote: 2009/10/4 Warren war...@wantonhubris.com: I'm a little confused on this one. I have a Vector class that I want to be able to multiply by either another vector or by a single