Skip to content

Fix more references to datetime and time classes #114717

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

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ Instance methods:
``tzinfo=None`` can be specified to create a naive datetime from an aware
datetime with no conversion of date and time data.

:class:`datetime` objects are also supported by generic function
:class:`.datetime` objects are also supported by generic function
:func:`copy.replace`.

.. versionchanged:: 3.6
Expand Down Expand Up @@ -1678,7 +1678,7 @@ Usage of ``KabulTz`` from above::
:class:`.time` Objects
----------------------

A :class:`time` object represents a (local) time of day, independent of any particular
A :class:`.time` object represents a (local) time of day, independent of any particular
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I don't think it's worth its own PR to make just this change, but FWIW, I would have just suppressed the link here, i.e.

Suggested change
A :class:`.time` object represents a (local) time of day, independent of any particular
A :class:`!time` object represents a (local) time of day, independent of any particular

The link is not useful, as it only takes the user two lines lower on the same page. It only adds visual clutter to the docs

day, and subject to adjustment via a :class:`tzinfo` object.

.. class:: time(hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0)
Expand Down Expand Up @@ -1836,7 +1836,7 @@ Instance methods:
``tzinfo=None`` can be specified to create a naive :class:`.time` from an
aware :class:`.time`, without conversion of the time data.

:class:`time` objects are also supported by generic function
:class:`.time` objects are also supported by generic function
:func:`copy.replace`.

.. versionchanged:: 3.6
Expand Down Expand Up @@ -2522,7 +2522,7 @@ information, which are supported in ``datetime.strptime`` but are discarded by
``time.strptime``.

For :class:`.time` objects, the format codes for year, month, and day should not
be used, as :class:`time` objects have no such values. If they're used anyway,
be used, as :class:`!time` objects have no such values. If they're used anyway,
``1900`` is substituted for the year, and ``1`` for the month and day.

For :class:`date` objects, the format codes for hours, minutes, seconds, and
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/mailbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,8 @@ When a :class:`!MaildirMessage` instance is created based upon a
leading "From " or trailing newline. For convenience, *time_* may be
specified and will be formatted appropriately and appended to *from_*. If
*time_* is specified, it should be a :class:`time.struct_time` instance, a
tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use
:meth:`time.gmtime`).
tuple suitable for passing to :func:`time.strftime`, or ``True`` (to use
:func:`time.gmtime`).


.. method:: get_flags()
Expand Down Expand Up @@ -1508,8 +1508,8 @@ When a :class:`!BabylMessage` instance is created based upon an
leading "From " or trailing newline. For convenience, *time_* may be
specified and will be formatted appropriately and appended to *from_*. If
*time_* is specified, it should be a :class:`time.struct_time` instance, a
tuple suitable for passing to :meth:`time.strftime`, or ``True`` (to use
:meth:`time.gmtime`).
tuple suitable for passing to :func:`time.strftime`, or ``True`` (to use
:func:`time.gmtime`).


.. method:: get_flags()
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ datetime
--------

Added new alternate constructors :meth:`datetime.date.fromisocalendar` and
:meth:`datetime.datetime.fromisocalendar`, which construct :class:`date` and
:class:`datetime` objects respectively from ISO year, week number, and weekday;
:meth:`datetime.datetime.fromisocalendar`, which construct :class:`~datetime.date` and
:class:`~datetime.datetime` objects respectively from ISO year, week number, and weekday;
these are the inverse of each class's ``isocalendar`` method.
(Contributed by Paul Ganssle in :issue:`36004`.)

Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.13.0a1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2276,7 +2276,7 @@ creation.
.. nonce: m2H5Bk
.. section: Library

Remove unnecessary extra ``__slots__`` in :py:class:`datetime`\'s pure
Remove unnecessary extra ``__slots__`` in :class:`~datetime.datetime`\'s pure
python implementation to reduce memory size, as they are defined in the
superclass. Patch by James Hilton-Balfe

Expand Down