[Django] #35825: Document None return type for dateparse functions

4 views
Skip to first unread message

Django

unread,
Oct 9, 2024, 2:35:41 PM10/9/24
to django-...@googlegroups.com
#35825: Document None return type for dateparse functions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
[https://docs.djangoproject.com/en/dev/ref/utils/#module-
django.utils.dateparse This documentation section] for functions in the
dateparse utils module does not cover that the contained functions can
return None when they fail to parse the given value (I think that applies
to all of them - worth checking). Let’s add that documentation and some
usage examples on the way. The examples would probably be best in Python
console code blocks.
--
Ticket URL: <https://code.djangoproject.com/ticket/35825>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 10, 2024, 3:55:02 AM10/10/24
to django-...@googlegroups.com
#35825: Document None return type for dateparse functions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Justas
Type: | Trimailovas
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Justas Trimailovas):

* owner: (none) => Justas Trimailovas
* status: new => assigned

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

Django

unread,
Oct 10, 2024, 4:09:38 AM10/10/24
to django-...@googlegroups.com
#35825: Document None return type for dateparse functions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: | Status: assigned
Cleanup/optimization |
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Justas Trimailovas):

* owner: Justas Trimailovas => (none)

--
Ticket URL: <https://code.djangoproject.com/ticket/35825#comment:2>

Django

unread,
Oct 10, 2024, 4:09:55 AM10/10/24
to django-...@googlegroups.com
#35825: Document None return type for dateparse functions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: dev
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => invalid
* status: assigned => closed

Comment:

I think it does state it at the top, the 3rd bullet point?

{{{
The functions defined in this module share the following properties:

- They accept strings in ISO 8601 date/time formats (or some close
alternatives) and return objects from the corresponding classes in
Python's
:mod:`datetime` module.
- They raise :exc:`ValueError` if their input is well formatted but isn't
a
valid date or time.
- They return ``None`` if it isn't well formatted at all.
- They accept up to picosecond resolution in input, but they truncate it
to
microseconds, since that's what Python supports.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35825#comment:3>
Reply all
Reply to author
Forward
0 new messages