-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between types with type arguments and without them #2537
Comments
|
So, my fix for this problem (very straight-forward): origin_handler = _global_type_lookup.get(origin)
if origin_handler:
return origin_handler if isinstance(origin_handler, st.SearchStrategy) else origin_handler(thing)I have patched the code here: https://github.com/HypothesisWorks/hypothesis/blob/master/hypothesis-python/src/hypothesis/strategies/_internal/types.py#L183 Does this look like something in the right direction? |
|
Yeah, I think that would work - we'll just need some user-defined generic types to test with. It's still possible that I'll look at the results and decide that this is the wrong approach, but I think it's unlikely if this does solve your problem without breaking anything else. |
|
I will send a PR shorly. |
|
This is only the case for |
I have this code:
Then, I use this code to generate values based on this annotation:
So, the thing is that just
MappableNdoes not work when trying to use it as a type inst.register_type_strategy. Output for the broken case:I guess, that using
MappableN[_FirstType, _SecondType, _ThirdType]to register a type is incorrect, because types should be used like this.The text was updated successfully, but these errors were encountered: