We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there a way to benefit from the best of both worlds: [uniqueness] from set and length constraints from conlist()? - @neimad1985 in #1472 (comment)
Also important to me is that sets are unordered.
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
pydantic version: 1.5.1 pydantic compiled: True install path: .../venv/lib/python3.8/site-packages/pydantic python version: 3.8.1 (default, Feb 19 2020, 09:57:06) [Clang 11.0.0 (clang-1100.0.33.17)] platform: macOS-10.15.5-x86_64-i386-64bit optional deps. installed: []
Example behavior:
from pydantic import conset class ConSetModel(BaseModel): v: conset(int, max_items=3) print(ConSetModel(v=[1, 2, 2]).v) # {1, 2} print(ConSetModel(v=[1, 2, 2, 3]).v) # {1, 2, 3} print(ConSetModel(v=[1, 2, 3, 4]).v) # raises ValidationError
The text was updated successfully, but these errors were encountered:
👍 PR welcome.
Sorry, something went wrong.
fixed by #1627
No branches or pull requests
Feature Request
Also important to me is that sets are unordered.
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:Example behavior:
The text was updated successfully, but these errors were encountered: