[pypy-dev] PyPy's PyDateTime_Delta definition

Amaury Forgeot d'Arc amauryfa at gmail.com
Sat Sep 7 12:28:35 CEST 2013


2013/9/7 Armin Rigo <arigo at tunes.org>

> It seems that "struct PyDateTime_Delta" is supposed to be purely
> read-only.  In case situation, wouldn't it make sense to expose a
> structure with a similar layout?  I don't think we care about the
> overhead of copying three words; the only annoying case is about
> read-write objects, when we want the changes in C to be reflected back
> to the Python world.
>

This is right.
But datetime classes are difficult to handle in cpyext, because they are
pure-python classes. They don't have a specific "TypeDef", and cpyext ties
the C structs to those typedefs.
See sliceobject.py for a simple example of filling the C struct; I don't
know how to do this for datetime.

-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20130907/9ec87d83/attachment.html>


More information about the pypy-dev mailing list