Can you set a class instance's attributes to zero by setting the instance to zero?

2005-11-19 Thread Gerard Flanagan
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__ =

Re: Can you set a class instance's attributes to zero by setting the instance to zero?

2005-11-19 Thread Diez B. Roggisch
Gerard Flanagan wrote: 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? No, you

Re: Can you set a class instance's attributes to zero by setting the instance to zero?

2005-11-19 Thread Terry Hancock
On 19 Nov 2005 05:29:07 -0800 Gerard Flanagan [EMAIL PROTECTED] wrote: 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) As has already been mentioned, A = 0 rebinds the name A to the