-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Description
If we have MaxLen
, and (in pydantic at least) that can be set via a max_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)
or max_length=5
or Len(0, 5)
means:
"The airbnb allows maximum 5 guests", you would assume 5 guests were allowed, not just 4
If for the sake of correctness, that involves either:
- treating slices differently
- or, removing the recommendation on allowing slices
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.
Metadata
Metadata
Assignees
Labels
No labels