[GRASS-dev] PyGRASS Module error handling

Pietro peter.zamb at gmail.com
Mon Jun 30 22:28:05 PDT 2014


On Tue, Jul 1, 2014 at 3:10 AM, Vaclav Petras <wenzeslaus at gmail.com> wrote:
> I must admit that I'm not sure whose assignment operator is called.
> Parameters, or the function for adding item to the dictionary? Assignment
> operator cannot be overloaded in Python. So, it seems that it must the the
> later. So, the only solution is TypeDict which is already used. I'm
> confused. Now focusing on something else.

the attributes: inputs and outputs are TypeDict objects that inherit
from OrderedDict and just check before to insert in the dictionary
that the value is of a certain type, in our case a Parameter instance.
Se the method that is called when you are trying to set an item to a
TypeDict is __setitem__.

I hope it makes sense.

Best regards

Pietro


More information about the grass-dev mailing list