- changed title to returning None if Paremeter key is unset can break Parameter.update
returning None if Paremeter key is unset can break Parameter.update
Issue #661
wontfix
The following modification in post.i should fix this.
def __setitem__(self, key, value):
"Set the parameter 'key', with given 'value'"
if (key == "this") and type(value).__name__ == 'SwigPyObject':
self.__dict__[key] = value
return
if key not in self._get_parameter_keys():
raise KeyError("'%s' is not a parameter"%key)
if not isinstance(value,(int,str,float,bool)) and (value is not None):
raise TypeError("can only set 'int', 'bool', 'float' and 'str' for parameter %s"%key)
par = self._get_parameter(key)
if isinstance(value,bool):
par._assign_bool(value)
elif value is None:
pass
else:
par._assign(value)
Comments (4)
-
reporter -
Could you post sample code for producing the error, and post your proposed fix as a diff?
-
- removed milestone
Removing milestone: 1.7 (automated comment)
-
- changed status to wontfix
Closing this due to missing response from the reporter.
- Log in to comment