Hello If I have the Vector class below, is there a means by which I can have the following behaviour
>>>A = Vector(1, 2)
>>>print A
(1, 2)
>>>A = 0
>>>print A
(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)
--
http://mail.python.org/mailman/listinfo/python-list
