Skip to content

Commit 75227fb

Browse files
authored
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.
1 parent 76efcb4 commit 75227fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/datetime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ Other constructors, all class methods:
975975
microsecond of the result are all 0, and :attr:`.tzinfo` is ``None``.
976976

977977

978-
.. classmethod:: datetime.combine(date, time, tzinfo=self.tzinfo)
978+
.. classmethod:: datetime.combine(date, time, tzinfo=time.tzinfo)
979979

980980
Return a new :class:`.datetime` object whose date components are equal to the
981981
given :class:`date` object's, and whose time components

0 commit comments

Comments
 (0)