[SAGA-RG] SAGA attributes as Python dictionaries?

Steve Fisher dr.s.m.fisher at gmail.com
Wed Nov 4 11:59:11 CST 2009


In fact it is simpler than that - as all the checking for extensible
attributes and dealing with default values is done in the java or C++
so all the __setitem__ etc functions have to do is to call down to the
underlying layer.

Steve

2009/11/4 Steve Fisher <dr.s.m.fisher at gmail.com>:
> Just a note to remind people that the dictionary syntax in python is
> just a convenience - you need to implement __setitem__, __getitem__,
> __delitem__ etc. Our __setitem__   can reject requests to set fields
> whoch don't already exist for those cases where the set of attributes
> is not extensible. It just needs a private method called by the
> implementation to set the attributes with any defalt values and
> indicate whether or not it is extensible. I think it is best to try it
> and see if there are any practical problems. Also see:
> http://docs.python.org/library/userdict.html#module-UserDict which may
> be useful.
>
> Steve
>


More information about the saga-rg mailing list