Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-117398: datetime: Use wrappers for C-API functions #118115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove _ex _ex2 suffixes from capi funcs
  • Loading branch information
neonene authored Apr 20, 2024
commit aa573b5d46188da0bc6f55b52819e1adc3cd5c08
20 changes: 10 additions & 10 deletions 20 Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ new_datetime_ex(int year, int month, int day, int hour, int minute,
}

static PyObject *
new_datetime_ex_capi(int year, int month, int day, int hour, int minute,
new_datetime_capi(int year, int month, int day, int hour, int minute,
int second, int usecond, PyObject *tzinfo,
PyTypeObject *type)
{
Expand All @@ -1057,7 +1057,7 @@ new_datetime_ex_capi(int year, int month, int day, int hour, int minute,
}

static PyObject *
new_datetime_ex2_capi(int year, int month, int day, int hour, int minute,
new_datetime_fold_capi(int year, int month, int day, int hour, int minute,
int second, int usecond, PyObject *tzinfo, int fold,
PyTypeObject *type)
{
Expand Down Expand Up @@ -1163,15 +1163,15 @@ new_time_ex2(int hour, int minute, int second, int usecond,
}

static PyObject *
new_time_ex_capi(int hour, int minute, int second, int usecond,
PyObject *tzinfo, PyTypeObject *type)
new_time_capi(int hour, int minute, int second, int usecond,
PyObject *tzinfo, PyTypeObject *type)
{
return new_time_ex2(hour, minute, second, usecond, tzinfo, 0, type);
}

static PyObject *
new_time_ex2_capi(int hour, int minute, int second, int usecond,
PyObject *tzinfo, int fold, PyTypeObject *type)
new_time_fold_capi(int hour, int minute, int second, int usecond,
PyObject *tzinfo, int fold, PyTypeObject *type)
{
return new_time_ex2(hour, minute, second, usecond, tzinfo, fold, type);
}
Expand Down Expand Up @@ -6754,14 +6754,14 @@ get_datetime_capi(void)
capi->DeltaType = &PyDateTime_DeltaType;
capi->TZInfoType = &PyDateTime_TZInfoType;
capi->Date_FromDate = new_date_ex;
capi->DateTime_FromDateAndTime = new_datetime_ex_capi;
capi->Time_FromTime = new_time_ex_capi;
capi->DateTime_FromDateAndTime = new_datetime_capi;
capi->Time_FromTime = new_time_capi;
capi->Delta_FromDelta = new_delta_ex;
capi->TimeZone_FromTimeZone = new_timezone_capi;
capi->DateTime_FromTimestamp = datetime_fromtimestamp;
capi->Date_FromTimestamp = datetime_date_fromtimestamp_capi;
capi->DateTime_FromDateAndTimeAndFold = new_datetime_ex2_capi;
capi->Time_FromTimeAndFold = new_time_ex2_capi;
capi->DateTime_FromDateAndTimeAndFold = new_datetime_fold_capi;
capi->Time_FromTimeAndFold = new_time_fold_capi;
// Make sure this function is called after utc has
// been initialized.
datetime_state *st = STATIC_STATE();
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.