G
Gerard Flanagan
Hello
If I have the Vector class below, is there a means by which I can have
the following behaviour
(0, 0)
If there is such a means, will it still work with the __slots__
attribution uncommented?
Thanks
class Vector(object):
#__slots__ = ('x', 'y')
def __init__(self, a=0, b=0 ):
self.x = a
self.y = b
def __repr__(self):
return '(%s, %s)' % (self.x, self.y)
If I have the Vector class below, is there a means by which I can have
the following behaviour
(0, 0)
If there is such a means, will it still work with the __slots__
attribution uncommented?
Thanks
class Vector(object):
#__slots__ = ('x', 'y')
def __init__(self, a=0, b=0 ):
self.x = a
self.y = b
def __repr__(self):
return '(%s, %s)' % (self.x, self.y)