]> granicus.if.org Git - python/commitdiff
bpo-31545: Update documentation containing timedelta repr. (GH-3687)
authorUtkarsh Upadhyay <mail@musicallyut.in>
Fri, 27 Oct 2017 11:25:15 +0000 (13:25 +0200)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 27 Oct 2017 11:25:15 +0000 (14:25 +0300)
This is a fix to the documentation to reflect the changes merged
in as part of bpo-30302.

Doc/library/datetime.rst

index d032d283eb9b53b100ee0d2f025e54d8b4398f4d..dce51a16e868a46a17e829de659269e2c389ab6c 100644 (file)
@@ -365,13 +365,13 @@ Example usage:
     True
     >>> ten_years = 10 * year
     >>> ten_years, ten_years.days // 365
-    (datetime.timedelta(3650), 10)
+    (datetime.timedelta(days=3650), 10)
     >>> nine_years = ten_years - year
     >>> nine_years, nine_years.days // 365
-    (datetime.timedelta(3285), 9)
+    (datetime.timedelta(days=3285), 9)
     >>> three_years = nine_years // 3
     >>> three_years, three_years.days // 365
-    (datetime.timedelta(1095), 3)
+    (datetime.timedelta(days=1095), 3)
     >>> abs(three_years - ten_years) == 2 * three_years + year
     True
 
@@ -1354,12 +1354,12 @@ Using datetime with tzinfo:
     >>> dt1.dst()
     datetime.timedelta(0)
     >>> dt1.utcoffset()
-    datetime.timedelta(0, 3600)
+    datetime.timedelta(seconds=3600)
     >>> dt2 = datetime(2006, 6, 14, 13, 0, tzinfo=gmt1)
     >>> dt2.dst()
-    datetime.timedelta(0, 3600)
+    datetime.timedelta(seconds=3600)
     >>> dt2.utcoffset()
-    datetime.timedelta(0, 7200)
+    datetime.timedelta(seconds=7200)
     >>> # Convert datetime to another time zone
     >>> dt3 = dt2.astimezone(GMT2())
     >>> dt3     # doctest: +ELLIPSIS