[Python-Dev] Re: [Python-checkins] python/dist/src/Modules threadmodule.c, 2.56, 2.56.8.1

"Martin v. Löwis" martin at v.loewis.de
Thu Sep 2 19:36:43 CEST 2004


Guido van Rossum wrote:
>>Now if some platform header file has macros with names like
>>
>>    PyDateTime_FromTimestamp
>>or
>>    PyDelta_FromDSU
>>
>>then adding these macros to datetime.h could cause new problems.  But
>>platform header files don't have macros with names like those (if they
>>did, we would have bumped into it while developing 2.4).
> 
> 
> Hm, Anthony, what do you think now?

I'm not Anthony (neither, actually), but I do think this is a new
feature, not a bug fix - assuming we are talking about the changes
between datetime.h in 2.3 and 2.4.

This introduces datetime.datetime_CAPI, which is a C object
allowing cross-module datetime calls at the C level.

This change is very unlikely to break existing code, as existing
code just won't use that new API. This is good for a backport.

At the same time, this also clearly shows it is a new feature:
only new code can use it.

Channelling Anthony (Baxter), this cannot be accepted for 2.3.
It would allow for code that works on 2.3.5, but fails on 2.3.4.
What's worse, the extension module can be built on 2.3.5, and
the binary module will fail when run on 2.3.4, as importing the
CAPI object would fail.

People who rely on that feature should get a compile time
error on 2.3.x, instead of compilation succeeding for some x.
People who need to support 2.3 as well should use the Python
API to the datetime module, not the C API.

Regards,
Martin




More information about the Python-Dev mailing list