You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned by @jlstevens in #582 , it's odd that an Array parameter forces allow_None to True:
classArray(ClassSelector):
""" Parameter whose value is a numpy array. """def__init__(self, default=None, **params):
fromnumpyimportndarraysuper(Array, self).__init__(ndarray, allow_None=True, default=default, **params)
I'm guessing that the original reason for that was to make the code able to work when NumPy is not available, but because we always assume allow_None to be True if the default is None, here having a None default should be sufficient already, without forcing all Array instances to allow None. Fixing this will be a breaking change, since any user of Array that does want to allow None will now have to supply that flag explicitly, but it seems the right thing to do.
The text was updated successfully, but these errors were encountered:
As mentioned by @jlstevens in #582 , it's odd that an Array parameter forces
allow_None
to True:I'm guessing that the original reason for that was to make the code able to work when NumPy is not available, but because we always assume
allow_None
to be True if the default isNone
, here having aNone
default should be sufficient already, without forcing allArray
instances to allow None. Fixing this will be a breaking change, since any user of Array that does want to allow None will now have to supply that flag explicitly, but it seems the right thing to do.The text was updated successfully, but these errors were encountered: