Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
typing.Hashable and typing.Sized error on inference #2272
typing.Hashable and typing.Sized error on inference
heres an minimum example to reproduce the error:
from typing import Hashable from hypothesis import given, infer @given(key=infer) def test_setitem_with_hashable(key: Hashable): d = dict() d[key] = 1 assert d[key] == 1
expected behaviour: infer infers a strategy of hashable objects from my type hint OR errors gracefully and tells me I can't use
inferring a strategy based on
which is good because
I had a look for other things in the typing module with these properties and i can see that
how can I help?
I'm happy to put up a PR to patch these in to strategies._internal.types.py
Let me know if you're happy for me to go ahead i will get to work on a PR.