Refactor validators
sobolevn opened this issue · 0 comments
sobolevn commented
Right now validators are very complicated.
They do a lot of stuff:
- Type inference
- Conditional logic
- etc
Most of the problematic validators return Tuple
or Context
types.
Validators must do just one thing: validation.
Other steps should be executed on a higher level.
.instance
call steps should be:
- We infer everything we need:
runtime_type
,instance_type
, etc - We register things we need with
mro.metadata
- Then we validate everything we need
- Error handling / etc