Open adrianeboyd opened 1 month ago
As you have identified, this only happens when a set is used with enums and if the expected length of this set is higher than the enum members (it will never find find elements to satisfy this, so it keeps looping). What can be the expected behavior here?
If __min_collection_length__ > len(finite_members)
and if "container is a type that guarantees uniqueness and the possible elements themselves are finite", I can think of two ways.
{1, 1, 1}
does not error out, it is the same as {1}
)With the combination of the default max collection length (that you can't differentiate from a user-specified value?) and the fact that it seems difficult to set max length values for individual fields, I would think all enum values (+ potentially a warning, but the library doesn't seem to use warnings much) is better than an exception?
Description
A model using
Set[Enum]
hangs when the collection length exceeds the size of the enum.The example below is intended to be reproducible, I think you'd run into it more typically in practice with a randomized collection length and a (default) max collection length that's larger than the size of the set.
URL to code causing the issue
No response
MCVE
Steps to reproduce
No response
Screenshots
No response
Logs
No response
Release Version
2.16.2
Platform