Re: class __getitem__ when item is not a sequence ???

2007-04-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Sorry for the vague subject. Not sure what the right terminology is. > > How can I use an instance's data by reference to the instance name, > not the instance attribute? OK the question is probably really poor > but hopefully an example will make it clear. > > >>x=

Re: class __getitem__ when item is not a sequence ???

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 16:47:55 -0700, cfriedalek wrote: > Sorry for the vague subject. Not sure what the right terminology is. > > How can I use an instance's data by reference to the instance name, > not the instance attribute? OK the question is probably really poor > but hopefully an example wil

class __getitem__ when item is not a sequence ???

2007-04-19 Thread cfriedalek
Sorry for the vague subject. Not sure what the right terminology is. How can I use an instance's data by reference to the instance name, not the instance attribute? OK the question is probably really poor but hopefully an example will make it clear. > x=1 > type(x) > x.__add__(1) 2 > print x 1 >