[Python-checkins] Elaborate datetime.timedelta docstring (GH-7458)

Miss Islington (bot) webhook-mailer at python.org
Fri Oct 19 19:08:18 EDT 2018

commit: 47413fe608c8ecea3b8c4c6341442fd4174160c6
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-10-19T16:08:14-07:00

Elaborate datetime.timedelta docstring (GH-7458)

(cherry picked from commit d6a61f232619f8a8e6efacc3da5a02abaf25f090)

Co-authored-by: Chris Barker <Chris.Barker at noaa.gov>

M Modules/_datetimemodule.c

diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 64928b1f81c1..afc865e466de 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -2413,7 +2413,11 @@ static PyMethodDef delta_methods[] = {
 static const char delta_doc[] =
-PyDoc_STR("Difference between two datetime values.");
+PyDoc_STR("Difference between two datetime values.\n\n"
+          "timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, "
+          "minutes=0, hours=0, weeks=0)\n\n"
+          "All arguments are optional and default to 0.\n"
+          "Arguments may be integers or floats, and may be positive or negative.");
 static PyNumberMethods delta_as_number = {
     delta_add,                                  /* nb_add */

More information about the Python-checkins mailing list