[Django] #34260: Field reference documentation doesn't mention that +inf, -inf, and NaN are invalid

3 views
Skip to first unread message

Django

unread,
Jan 15, 2023, 6:39:29 AM1/15/23
to django-...@googlegroups.com
#34260: Field reference documentation doesn't mention that +inf, -inf, and NaN are
invalid
-------------------------------------+-------------------------------------
Reporter: Matt | Owner: nobody
Cooper |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 4.1
Documentation |
Severity: Normal | Keywords: floatfield
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34260>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 15, 2023, 6:48:05 AM1/15/23
to django-...@googlegroups.com
#34260: Field reference documentation doesn't mention that +inf, -inf, and NaN are
invalid
-------------------------------------+-------------------------------------
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
-------------------------------------+-------------------------------------

Comment (by Matt Cooper):

https://github.com/django/django/pull/16455 proposes a fix for the dev
documentation. This change could (should?) also be backported to all
supported Django versions.

--
Ticket URL: <https://code.djangoproject.com/ticket/34260#comment:1>

Reply all
Reply to author
Forward
0 new messages