Re: Newbie question about class operator overloading

2005-02-16 Thread Steven Bethard
Rory Campbell-Lange wrote: Hi Steve I've been playing around with your two suggestions. The Record class is an elegant solution. It doesn't however help in the case where the class has the following general data structure (something I should have stated originally): class.config1 = param

Re: Newbie question about class operator overloading

2005-02-16 Thread Rory Campbell-Lange
Hi Steve I've been playing around with your two suggestions. The Record class is an elegant solution. It doesn't however help in the case where the class has the following general data structure (something I should have stated originally): class.config1 = param class.config2 = param

Re: Newbie question about class operator overloading

2005-02-15 Thread Steven Bethard
Rory Campbell-Lange wrote: Hi. I'm just starting to use python. I am anxious about how best to set and access items one level down in a data structure if I am using __setitem__ and __getitem__. At the moment I can do for a data structure Data: object.Data = { 'one' : [1, 2, {}, 4],

Re: Newbie question about class operator overloading

2005-02-15 Thread Rory Campbell-Lange
Anyone out there? Criticism about the objective of my question, not just the execution, gratefully received! Basically, if I have a class This: def __init__(self, x, y): self.x=x self.y=y self.data = {} and then make all my setitem and getitem cal

Newbie question about class operator overloading

2005-02-15 Thread Rory Campbell-Lange
Hi. I'm just starting to use python. I am anxious about how best to set and access items one level down in a data structure if I am using __setitem__ and __getitem__. At the moment I can do for a data structure Data: object.Data = { 'one' : [1, 2, {}, 4], 'two' : [5, 6,