[Python-checkins] datetime.rst: fix combine() signature (#101490)

abalkin webhook-mailer at python.org
Wed Feb 1 05:01:36 EST 2023


https://github.com/python/cpython/commit/75227fba1dd1683289d90ada7abba237bff55d14
commit: 75227fba1dd1683289d90ada7abba237bff55d14
branch: main
author: John Belmonte <john at neggie.net>
committer: abalkin <abalkin at users.noreply.github.com>
date: 2023-02-01T14:01:28+04:00
summary:

datetime.rst: fix combine() signature (#101490)

The default `tzinfo` param of the `combine()` signature pseudocode was erroneously `self.tzinfo`.

`self` has no meaning in the context of a classmethod, and the datetime class itself has no `tzinfo` attribute.  The correct default pseudocode is `time.tzinfo`, reflecting that the default is the `tzinfo` attribute of the `time` parameter.

files:
M Doc/library/datetime.rst

diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index ebb5f319efda..2f1ab7c3dd4b 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -975,7 +975,7 @@ Other constructors, all class methods:
    microsecond of the result are all 0, and :attr:`.tzinfo` is ``None``.
 
 
-.. classmethod:: datetime.combine(date, time, tzinfo=self.tzinfo)
+.. classmethod:: datetime.combine(date, time, tzinfo=time.tzinfo)
 
    Return a new :class:`.datetime` object whose date components are equal to the
    given :class:`date` object's, and whose time components



More information about the Python-checkins mailing list