[Tutor] Required method to make foo(*Vector(0,0,0)) work.
adam.jtm30 at gmail.com
Wed Dec 19 04:02:17 CET 2007
On 19/12/2007, John Fouhy <john at fouhy.net> wrote:
> On 19/12/2007, Adam Bark <adam.jtm30 at gmail.com> wrote:
> > I want to be able to get the values for my vector class but I don't know
> > what method you need to get the * thing to work ie how to make it a
> > i think. Anybody know how to do this?
> > Thanks in advance.
> If you're confused about python's *args / **kwargs syntax, this post I
> wrote a while ago might help:
> Otherwise, as Kent says, we need more information.
Sorry I wasn't quite sure how to explain it it's a vector class i've written
I've worked it out now, I was using a vector as part of a quaternion and
be able to pass a vector or individual numbers so it seemed the easiest way
able to use the *sequence syntax. Apparently you have to have to have a
__getitem__ method for it to work.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor