You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We default arguments to None where we don't have a known bound (e.g. integers()), or where a non-None default argument would require us to weaken our checks for consistency (e.g. if min_value defaulted to -inf for floats(), we couldn't warn a user who passed min_value=-inf, allow_infinity=False). For strategies such as dates() we don't accept None at all!
It turns out that neither of these reasons apply to minimum sizes! We should therefore:
Set min_size=0 as the default for all size arguments
We default arguments to
Nonewhere we don't have a known bound (e.g.integers()), or where a non-Nonedefault argument would require us to weaken our checks for consistency (e.g. ifmin_valuedefaulted to-infforfloats(), we couldn't warn a user who passedmin_value=-inf, allow_infinity=False). For strategies such asdates()we don't acceptNoneat all!It turns out that neither of these reasons apply to minimum sizes! We should therefore:
min_size=0as the default for all size argumentshypothesis.internal.validation.check_valid_size, add a checkif name == 'min_size' and value is None:and usenote_deprecationto warn users that they should usemin_size=0instead.git grep --line-number --perl-regexp "min_size ?= ?None"hypothesis-python/tests/cover/test_validation.pythat uses@checks_deprecated_behaviourand passesmin_size=Nonetolists().The text was updated successfully, but these errors were encountered: