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
Default of allow_inf_nan
for Decimal
and float
are inconsistent
#7296
Comments
update pydantic core
to
|
Just a question: Considering this code:
Validates even though I have asked for >0. |
@behrenhoff I agree that's a bug, opened pydantic/pydantic-core#1037 to address. |
From pydantic/pydantic-core#1037 (comment)
@sasanjac - Maybe someone wants to allow positive infinity but not I wonder if this is motivation to split You could define your own |
I agree. Splitting the flags would improve usability a lot. |
Initial Checks
Description
Decimal
validation doesn't allow nan or infinity by default.float
validation does allow these values by default.We should consider making these defaults the same (possibly a V3 thing).
Example Code
Python, Pydantic & OS Version
Selected Assignee: @adriangb
The text was updated successfully, but these errors were encountered: