K
kuru
Hi
I have couple classes in the form of
class Vector:
def __init__(self,x,y,z):
self.x=x
self.y=y
self.z=z
This works fine for me. However I want to be able to provide a list,
tuple as well as individual arguments like below
myvec=Vector(1,2,3)
This works well
However I also want to be able to do
vect=[1,2,3]
myvec=Vec(vect)
I want this class to accept multiple data types but process them as
they are same when the classs deals with the instances.
thanks
I have couple classes in the form of
class Vector:
def __init__(self,x,y,z):
self.x=x
self.y=y
self.z=z
This works fine for me. However I want to be able to provide a list,
tuple as well as individual arguments like below
myvec=Vector(1,2,3)
This works well
However I also want to be able to do
vect=[1,2,3]
myvec=Vec(vect)
I want this class to accept multiple data types but process them as
they are same when the classs deals with the instances.
thanks