ConfigSpace
ConfigSpace copied to clipboard
[Maint] Typing for `is_legal` can be made more explicit
The typing for is_legal in HyperParameter is quite open and in general each subclass of HyperParameter is quite "open" with how it treats them, some checking for types explicitly while some rely on equivalence relation but not type, being a problem in cases like 1 == True.
Without going full generics on it which might discourage contributions I think the best solutions are:
- Use
Anyas the param type and have explicit type checking viaisinstance(possible performance point) - Have no type definition in base
is_legaland each subclass can introduce its own type signature, in which case. Noisinstancechecks and just let whatever error bubble up as a result of user error. Likely more performany due to no type checks.
Closed in #346