Re: method names in __slots__ ??

2006-12-25 Thread Rob Williscroft
John Machin wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Rob Williscroft wrote: >> John Machin wrote in news:1167008799.074885.250770@ >> 73g2000cwn.googlegroups.com in comp.lang.python: >> >> > Given a = Adder(), >> > a.tally = 0 >> > gets AttributeError: 'Adder' object attribute '

Re: method names in __slots__ ??

2006-12-25 Thread John Machin
Rob Williscroft wrote: > John Machin wrote in news:1167008799.074885.250770@ > 73g2000cwn.googlegroups.com in comp.lang.python: > > > Given a = Adder(), > > a.tally = 0 > > gets AttributeError: 'Adder' object attribute 'tally' is read-only > > a.notinslots = 1 > > gets AttributeError: 'Adde

Re: method names in __slots__ ??

2006-12-25 Thread Rob Williscroft
John Machin wrote in news:1167008799.074885.250770@ 73g2000cwn.googlegroups.com in comp.lang.python: > Given a = Adder(), > a.tally = 0 > gets AttributeError: 'Adder' object attribute 'tally' is read-only > a.notinslots = 1 > gets AttributeError: 'Adder' object attribute 'notinslots' is re

method names in __slots__ ??

2006-12-24 Thread John Machin
AttributeError: 'Adder' object attribute 'notinslots' is read-only So is there some magic class-fu going down here, or is this just a waste of memory space in the instances? === example === # class with method names in __slots__ class Adder(object): __slots__ = [