[Patches] [ python-Patches-876130 ] add C API to datetime module

SourceForge.net noreply at sourceforge.net
Mon Jan 26 15:46:06 EST 2004

Patches item #876130, was opened at 2004-01-13 16:20
Message generated for change (Comment added) made by lemburg
You can respond by visiting: 

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Anthony Tuininga (atuining)
Assigned to: M.-A. Lemburg (lemburg)
Summary: add C API to datetime module

Initial Comment:
The datetime module does not have a C API which means
that modules written in C cannot take advantage of the
datetime module without incurring significant overhead.
These patches supply this lack and are based on the C
API exported by the mxDateTime module and the cStringIO
module and enhanced as suggested by Guido.


>Comment By: M.-A. Lemburg (lemburg)
Date: 2004-01-26 21:46

Logged In: YES 

This is a good start. However, you should add more APIs for
extracting date/time information to the C API. mxDateTime.h
from egenix-mx-base can provide a good basis for this. 

If you want to make the datetime module usable for database
interfacing at C level, you'll also have to add interfaces for
Unix ticks conversion, since these are often used by database
C level interfaces.


Comment By: Anthony Tuininga (atuining)
Date: 2004-01-26 19:36

Logged In: YES 

I have no objection to providing patches for doc and test. A
quick look at _testcapimodule.c doesn't provide any obvious
ideas as to how to patch it. I looked for cStringIO which
has a C API already and found nothing in there at all. The
documentation also simply says "see the source for the
information you require". Any suggestions as to how to proceed?


Comment By: Tim Peters (tim_one)
Date: 2004-01-26 04:17

Logged In: YES 

Marc-Andre, can you review this?  I think you have more 
experience building C APIs for modules than anyone else 
(while I don't have any).

There's certainly no objection to giving datetime a C API, and 
Guido already said he doesn't want to rely on that Martin 
changed datetime to be built as part of the core (in 2.3 on 
Windows, datetime.pyd was a distinct DLL; in CVS, datetime 
is compiled into the core DLL now).

Anthony, you probably need to add doc and test patches.  
_testcapimodule.c holds tests of things you can only get at 
from C.


You can respond by visiting: 

More information about the Patches mailing list