Closed
Description
The datetime.h
header file provides two kinds of C API:
- Function pointers exposed via PyDateTime_CAPI structure and a PyCapsule object
- Macros like PyTime_Check() and PyTime_FromTime(): their implementation uses the function pointers
I propose converting these macros to regular functions to avoid leaking implementation details in the ABI. It moves this API closer to the limited C API and the stable ABI (PEP 384).
I propose a first PR to convert macros like PyTime_FromTime() to regular functions.
Later, I also plan to work on a separated PR to convert "GET" macros, like PyDateTime_GET_YEAR(), to static inline functions or regular functions.
Note: currently, datetime.h
is not included by Python.h
and is excluded from the limited C API.