#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are database-dependent.
-------------------------------------+-------------------------------------
Reporter: Matt Cooper | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: floatfield | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Matt Cooper:
Old description:
> The model field reference documentation doesn't mention that, in a
> FloatField, the values must pass `math.isfinite`. This excludes
> `float('inf')` (positive and negative) and `float('nan')`. I saw old
> discussion about why this is the case, but only after being bitten by it
> in a project. I'd like to submit a patch adding this info to the docs.
New description:
The model field reference documentation doesn't mention that, in a
FloatField, non-numeric values have database-dependent behavior.
`float('nan')` on SQLite requires the field to be nullable, for example. I
saw old discussion about why this is the case, but only after being bitten
by it in a project. I'd like to submit a patch adding this info to the
docs.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/34260#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070185ba9b2fc4-1d6635fd-b108-4c6e-8d9d-70caff7d382c-000000%40eu-central-1.amazonses.com.