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
Odd regression in sets in 3.16.1 #780
Comments
That's... really weird. Literally nothing on the path of that code has changed between 3.17.0 and 3.18.0. Can you double check that it's definitely working on 3.17.0? I can imagine 3.16.1 having broken this, but not 3.18.0. |
Also, which system and version of Python are you running this under? I can’t seem to reproduce the error in 2.7 or 3.6 on macOS. |
Whoops, it turns out that what I thought was a 100% reproducible result is in fact not 100%, and I minimized my test case a tiny bit more reducing the reproducibility a lot. This example hits the problem more often (also on 3.17.0 so I'm not sure any more when this regression hit, probably the big change back in 3.14 or whenever it was): from hypothesis import assume, given, strategies as s
def flags():
return s.sets(s.sampled_from([0]))
@given(on=flags(), off=flags())
def test(on, off):
pass
test() |
I'd say with reasonably high confidence that it would be 3.16.1 that introduced this. |
Seems to be supported experimentally: I ran this in a loop on 3.16.0 without hitting the health check, while on 3.16.1 I hit it fairly often. |
To answer @alexwlchan's question in case it's still relevant, the updated reproducer worked (although not 100%) on both CPython 2.7.13 and PyPy2 5.8.0. |
In 3.17.0, the following runs fine:
In 3.18.0, there is a failing health check:
While this use of sets/sampled_from is obviously somewhat degenerate, this seems like there may be something strange going wrong (in my actual use case, I'm sampling from a list that just happens to only have one item and may grow to a larger size in the future).
The text was updated successfully, but these errors were encountered: