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
My pet peeve about hypothesis.py is that it uses the plural booleans() to generate a single boolean. I think it is easier to understand that a single draw from a generator generates one instance of the thing. For example
functionf(ints)
sum(ints)
end
f takes a thing called ints which is supposed to be passed a sequence of integers. But Data.Integers() will pass it a single integer. I think this is confusing and it would be easier to understand if the way to generate one integer were Integer() and, if needed, a shortcut to generate multiple integers were Integers().
A counterargument is that it's more natural for map and filter to work on things that are named pural.
The text was updated successfully, but these errors were encountered:
The plural is intentional, since any given generator can generate multiple different instances. The plural also helps prevent punning the existing names like Vector, Dict and so on, preventing a situation where someone attempts to do using Supposition.Data: Vector immediately introducing a name clash with Base.
My pet peeve about hypothesis.py is that it uses the plural
booleans()
to generate a single boolean. I think it is easier to understand that a single draw from a generator generates one instance of the thing. For examplef
takes a thing calledints
which is supposed to be passed a sequence of integers. ButData.Integers()
will pass it a single integer. I think this is confusing and it would be easier to understand if the way to generate one integer wereInteger()
and, if needed, a shortcut to generate multiple integers wereIntegers()
.A counterargument is that it's more natural for
map
andfilter
to work on things that are named pural.The text was updated successfully, but these errors were encountered: