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
Rethink max_exclusive
, convert to max_inclusive
?
#23
Comments
My personal preference would be to treat slices e.g. But I can already hear the rumbling of disagreement as I write that. |
Yeah that is confusing to say the least!
My personal preference would be to remove slices. |
Yeah, this is a compelling argument. Let's remove slices and make both inclusive, and consider changing the name - min/max_len would match the other names, or min/max_size would match Hypothesis. |
Agreed, I'd prefer |
I'll submit a PR once #21 is merged. |
If we have
MaxLen
, and (in pydantic at least) that can be set via amax_length
argument.I really think this should mean "maximum inclusive", not "maximum exclusive" as currently documented.
This matches (IMHO) much better people's assumption about what
MaxLen(5)
ormax_length=5
orLen(0, 5)
means:If for the sake of correctness, that involves either:
That's sad, but I think a price worth paying.
At the end of the day
max_length=5
meaning any length up to 4, won't fly in pydantic.The text was updated successfully, but these errors were encountered: