RussBaz / enforce

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

What to do about __subclasshook__? #21

Closed RussBaz closed 7 years ago

RussBaz commented 7 years ago

What should we do about this? I am a bit unsure where to fit this in the current model.

Should this hook replace the entire inheritance check? Should this work only in covariant mode? Or should this be used for all cases other than invariant and expect users to know about this?

RussBaz commented 7 years ago

Implemented in the dev branch and will be available in 0.3.0 release (#25)

NOTE: It is only ignored in two cases: 'invariant' and 'generic' cases. In all other cases it is fully respected.