Re: How to make a function associated with a class?

2008-07-07 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Kurda Yon <[EMAIL PROTECTED]> wrote: > On Jul 1, 5:01 pm, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > > On 1 juil, 22:43, Kurda Yon <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > > > I have a class called "vector". And I would like to define a funct

Re: How to make a function associated with a class?

2008-07-02 Thread Bruno Desthuilliers
Kurda Yon a écrit : On Jul 1, 5:01 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: On 1 juil, 22:43, Kurda Yon <[EMAIL PROTECTED]> wrote: Hi, I have a class called "vector". And I would like to define a function "dot" which would return a dot product of any two "vectors". I want to call

Re: How to make a function associated with a class?

2008-07-01 Thread John Roth
On Jul 1, 2:43 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outsid

Re: How to make a function associated with a class?

2008-07-01 Thread [EMAIL PROTECTED]
On Jul 1, 2:24 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > > By the way, "type(self)" returns the name of the class to which the > "self" belongs? > Does "instance" return "true" if the first argument belongs to the > class whose name is given in the second argument? $ python Python 2.5.1 (r251:548

Re: How to make a function associated with a class?

2008-07-01 Thread [EMAIL PROTECTED]
On Jul 1, 1:43 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outsid

Re: How to make a function associated with a class?

2008-07-01 Thread Victor Noagbodji
> > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outside the class and it works > exactly as I want. However,

Re: How to make a function associated with a class?

2008-07-01 Thread Kurda Yon
On Jul 1, 5:01 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 1 juil, 22:43, Kurda Yon <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I have a class called "vector". And I would like to define a function > > "dot" which would return a dot product of any two "vectors". I want > > to call t

Re: How to make a function associated with a class?

2008-07-01 Thread [EMAIL PROTECTED]
On 1 juil, 22:43, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I have a class called "vector". And I would like to define a function > "dot" which would return a dot product of any two "vectors". I want > to call this function as follow: dot(x,y). > > Well, I can define a functions "dot" outside

How to make a function associated with a class?

2008-07-01 Thread Kurda Yon
Hi, I have a class called "vector". And I would like to define a function "dot" which would return a dot product of any two "vectors". I want to call this function as follow: dot(x,y). Well, I can define a functions "dot" outside the class and it works exactly as I want. However, the problem is