[Tutor] Required method to make foo(*Vector(0,0,0)) work.
Tiger12506
keridee at jayco.net
Wed Dec 19 05:08:42 CET 2007
> Sorry I wasn't quite sure how to explain it it's a vector class i've
> written
> myself.
> I've worked it out now, I was using a vector as part of a quaternion and
> wanted to
> be able to pass a vector or individual numbers so it seemed the easiest
> way
> to be
> able to use the *sequence syntax. Apparently you have to have to have a
> __getitem__ method for it to work.
Actually I think you can define a __list__ method. Hmmm. A quick python doc
check shows that I lied. Nevermind. Please disregard this email. Or I
suppose I could just not send it. But then again, I would have wasted all of
this time writing this. Gee. What to do? Hmmm.... hmm... I think it's
getting late. Yeah, I think you have the __getitem__ idea right.
More information about the Tutor
mailing list