]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
datetime.rst: fix combine() signature (#101490)
authorJohn Belmonte <john@neggie.net>
Wed, 1 Feb 2023 10:01:28 +0000 (19:01 +0900)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 10:01:28 +0000 (14:01 +0400)
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.

Doc/library/datetime.rst

index ebb5f319efda8d8ff4a8aa21532a2add875a9f4f..2f1ab7c3dd4b51dc89a428fad250cfc61a891a82 100644 (file)
@@ -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