[Cython] To Add datetime.pxd to cython.cpython

Robert Bradshaw robertwb at gmail.com
Fri Feb 22 09:03:47 CET 2013


These could be provided as inline functions in the pxd rather rather
than adding another hack like we did for array.

On Thu, Feb 21, 2013 at 11:01 PM, ZS <szport at gmail.com> wrote:
> Extended part is in datetime_ex.h:
>
> #include "datetime.h"
>
> #define PyDateTime_FromDateAndTimeEx(year, month, day, hour, min, sec,
> usec, tzinfo) \
>     PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, \
>         min, sec, usec, tzinfo, PyDateTimeAPI->DateTimeType)
>
> #define PyTime_FromTimeEx(hour, minute, second, usecond, tzinfo) \
>     PyDateTimeAPI->Time_FromTime(hour, minute, second, usecond, \
>         tzinfo, PyDateTimeAPI->TimeType)
>
> These macros allow to create dattime/time objects with tzinfo.
> Of course we could do:
>
>     t = PyTime_FromTime(........)
>     t = t.replace(tzinfo)
>
> in absence of that.
>
>
> Zaur Shibzukhov
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> http://mail.python.org/mailman/listinfo/cython-devel


More information about the cython-devel mailing list