Hypothesis: target() doesn't work with int input

Created on 25 Aug 2020  路  2Comments  路  Source: HypothesisWorks/hypothesis

If you call target() with an int input, you get an error like hypothesis.errors.InvalidArgument: Expected float but got observation=1 (type=int). It's rather unpythonic for a function that takes float inputs to not also work with ints.

legibility

Most helpful comment

I'm looking at this (as part of the PyCon sprints!)

All 2 comments

We had originally restricted this to floats-only to keep our options open for later, but I've played around with some plausible other uses now and accepting integers or finite floats would be fine for all of them. Let's just loosen the check!

I'm looking at this (as part of the PyCon sprints!)

Was this page helpful?
0 / 5 - 0 ratings