Open AdriaanRol opened 7 years ago
@nulinspiratie maybe this is already part of your recent parameter improvements?
@AdriaanRol It isn't at the moment. I think the question is how we want the parameter to behave before it has a value. Would the correct behaviour be to return None, or to raise an error immediately? I'm undecided on the matter, as it is sometimes useful to have parameters that can be initialized/set to None. It might also introduce bugs elsewhere if a parameter can raise errors during a get
We use a lot of ManualParameters in our meta instruments (I guess @nulinspiratie you do something similar). Sometimes we forget to set the value of such a parameter. When we then try to use it we get strange type errors resulting from using the
None
as a value somewhere else.Below is an example of such an exception that can be hard to debug if you are not aware of this.
I would propose adding a validate on get (
Boolean
) attribute to the parameter class so that we get the full context power (and checks) of the validators.