This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc
Date 2012-01-07.13:50:34
SpamBayes Score 1.315158e-07
Marked as misclassified No
Message-id <1325944236.57.0.0169968212645.issue13727@psf.upfronthosting.co.za>
In-reply-to
Content
All objects of the datetime module have macros to access their properties, except timedelta.
This simple patch adds the macros PyDateTime_DELTA_GET_DAYS, PyDateTime_DELTA_GET_SECONDS, PyDateTime_DELTA_GET_MICROSECONDS; module developers are encouraged to use these instead of obj->seconds for example.

Motivation:
PyPy cannot easily expose PyDateTime_Delta fields because datetime is implemented as a pure Python module and it's difficult to rebuild a C structure from a heap type.
In PyPy these macros are actually functions, which do something similar to PyLong_AsLong(PyObject_GetAttrString(obj, "seconds")):
https://bitbucket.org/pypy/pypy/src/b67e65d709e1/pypy/module/cpyext/cdatetime.py#cl-235
History
Date User Action Args
2012-01-07 13:50:36amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc
2012-01-07 13:50:36amaury.forgeotdarcsetmessageid: <1325944236.57.0.0169968212645.issue13727@psf.upfronthosting.co.za>
2012-01-07 13:50:35amaury.forgeotdarclinkissue13727 messages
2012-01-07 13:50:35amaury.forgeotdarccreate