Skip to content

Commit 3eeeb02

Browse files
Copilotm-aciek
andcommitted
Add documentation for datetime.__class_getitem__ support
Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
1 parent aa78e5f commit 3eeeb02

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Doc/library/datetime.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,11 @@ Constructor:
937937
.. versionchanged:: 3.6
938938
Added the *fold* parameter.
939939

940+
.. versionchanged:: 3.15
941+
:class:`!datetime` now supports the subscript (``[]``) operator for creating
942+
:class:`generic aliases <types.GenericAlias>`, e.g., ``datetime[int]``.
943+
See :pep:`585` and :ref:`types-genericalias`.
944+
940945
Other constructors, all class methods:
941946

942947
.. classmethod:: datetime.today()

0 commit comments

Comments
 (0)