diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2012-01-17 20:31:50 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2012-01-17 20:31:50 (GMT) |
commit | 5e8260b09c2aa3faa7ec4722b44e452072301b20 (patch) | |
tree | d3e307c0ecbdc97c5d7fee537f68ef500817a9bb /Doc/c-api | |
parent | 0174db50a51cbd03567c5502b3c5362a1357d1bd (diff) | |
download | cpython-5e8260b09c2aa3faa7ec4722b44e452072301b20.zip cpython-5e8260b09c2aa3faa7ec4722b44e452072301b20.tar.gz cpython-5e8260b09c2aa3faa7ec4722b44e452072301b20.tar.bz2 |
Issue #13727: Add 3 macros to access PyDateTime_Delta members:
PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS,
PyDateTime_DELTA_GET_MICROSECONDS.
Please use them instead of directly accessing PyDateTime_Delta struct members.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/datetime.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Doc/c-api/datetime.rst b/Doc/c-api/datetime.rst index fcd1395..39542bd 100644 --- a/Doc/c-api/datetime.rst +++ b/Doc/c-api/datetime.rst @@ -170,6 +170,31 @@ and the type is not checked: Return the microsecond, as an int from 0 through 999999. +Macros to extract fields from time delta objects. The argument must be an +instance of :c:data:`PyDateTime_Delta`, including subclasses. The argument must +not be *NULL*, and the type is not checked: + +.. c:function:: int PyDateTime_DELTA_GET_DAYS(PyDateTime_Delta *o) + + Return the number of days, as an int from -999999999 to 999999999. + + .. versionadded:: 3.3 + + +.. c:function:: int PyDateTime_DELTA_GET_SECONDS(PyDateTime_Delta *o) + + Return the number of seconds, as an int from 0 through 86399. + + .. versionadded:: 3.3 + + +.. c:function:: int PyDateTime_DELTA_GET_MICROSECOND(PyDateTime_Delta *o) + + Return the number of microseconds, as an int from 0 through 999999. + + .. versionadded:: 3.3 + + Macros for the convenience of modules implementing the DB API: .. c:function:: PyObject* PyDateTime_FromTimestamp(PyObject *args) |