Re: customized instance dictionaries, anyone?

2006-01-26 Thread Bengt Richter
On 25 Jan 2006 09:35:50 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: thx! indeed, it worked -- took me some time to figure out how to implement the setting of attributes, too. i finally managed to get that done using super: Seems good. snip the ``~.__setattr__()`` method tests for the

Re: customized instance dictionaries, anyone?

2006-01-25 Thread Bengt Richter
On 24 Jan 2006 09:30:00 -0800, [EMAIL PROTECTED] wrote: some time after posting my `Linkdict recipe`__ to aspn__ -- basically, a dictionary with run-time delegational lookup, but this is not important here -- i thought gee that would be fun to make such a customized dictionary thingie an instance

Re: customized instance dictionaries, anyone?

2006-01-25 Thread [EMAIL PROTECTED]
thx! indeed, it worked -- took me some time to figure out how to implement the setting of attributes, too. i finally managed to get that done using super: custom dictionary, unchanged:: class CustomDict( dict ): defaultValue = 'THIS ITEM NOT AVAILABLE' def __getitem__(

customized instance dictionaries, anyone?

2006-01-24 Thread wolfgang . lipp
some time after posting my `Linkdict recipe`__ to aspn__ -- basically, a dictionary with run-time delegational lookup, but this is not important here -- i thought gee that would be fun to make such a customized dictionary thingie an instance dictionary, and get some custom namespace behavior out