RussBaz / enforce

Python 3.5+ runtime type checking for integration testing and data validation
543 stars 21 forks source link

Global switch for type checking mode #20

Closed RussBaz closed 7 years ago

RussBaz commented 7 years ago

All the types are currently checked invariantly (i.e. it has to be the same as specified or it fails otherwise). This sometimes might not what our users expect. I think we should implement a global switch to change the type checking mode.

This switch should be able to specify whether type checking is: invariant, covariant, contravariant or bivariant.

TheDataLeek commented 7 years ago

This should follow the config pattern we have already established, and it shouldn't be hard to add this as a feature.

RussBaz commented 7 years ago

It has been implemented and merged into the dev branch. It will be available in 0.3.0 release (#25)