[Tutor] Required method to make foo(*Vector(0,0,0)) work.

Adam Bark 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
> sequence
> > 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:
> http://mail.python.org/pipermail/tutor/2007-April/053725.html
>
> Otherwise, as Kent says, we need more information.
>
> --
> John.
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071219/186638c6/attachment.htm 


More information about the Tutor mailing list