fixing mypy's Matcher[Never]
The idea is that manually unrolling these Union[Matcher[T], T] alternatives into @overload alternatives allows mypy to properly evaluate them in order, rather than getting confused and giving up (resulting in an inference of T = Never).
Closes: #266 #264
Two off-topic changes included: (you can revert them or ask me to)
uv syncwill now treatPyHamcrest[dev]as itsdev"dependency group"- full typing for the implementation of
has_entries
draft: adding some quick typechecking tests
Looks like we'd need to remove 3.8 support to make this work, which I am fine with.
3.8 compat restored. All type annotations regression tested (they fail with the "Matcher[Never]" error at HEAD, mostly).
Ready for merge, to the best of my ability.
happy monday!