Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,7 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor,
}

/*[clinic input]
@vectorcall
@classmethod
datetime.timedelta.__new__ as delta_new

Expand All @@ -2854,7 +2855,7 @@ static PyObject *
delta_new_impl(PyTypeObject *type, PyObject *days, PyObject *seconds,
PyObject *microseconds, PyObject *milliseconds,
PyObject *minutes, PyObject *hours, PyObject *weeks)
/*[clinic end generated code: output=61d7e02a92a97700 input=e8cd54819295d34b]*/
/*[clinic end generated code: output=61d7e02a92a97700 input=8aebc4cdef360d1f]*/
{
PyObject *self = NULL;

Expand Down Expand Up @@ -3182,6 +3183,7 @@ static PyTypeObject PyDateTime_DeltaType = {
0, /* tp_alloc */
delta_new, /* tp_new */
0, /* tp_free */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer tp_free, move it before tp_vectorcall.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Moved tp_vectorcall to the end.

.tp_vectorcall = delta_vectorcall,
};

// XXX Can we make this const?
Expand Down Expand Up @@ -4385,6 +4387,7 @@ static PyTypeObject PyDateTime_TZInfoType = {
};

/*[clinic input]
@vectorcall
@classmethod
datetime.timezone.__new__ as timezone_new

Expand All @@ -4396,7 +4399,7 @@ Fixed offset from UTC implementation of tzinfo.

static PyObject *
timezone_new_impl(PyTypeObject *type, PyObject *offset, PyObject *name)
/*[clinic end generated code: output=41a2dda500424187 input=d51255afe60382cd]*/
/*[clinic end generated code: output=41a2dda500424187 input=8901a8befbc52561]*/
{
return new_timezone(offset, name);
}
Expand Down Expand Up @@ -4641,6 +4644,7 @@ static PyTypeObject PyDateTime_TimeZoneType = {
0, /* tp_init */
0, /* tp_alloc */
timezone_new, /* tp_new */
.tp_vectorcall = timezone_vectorcall,
};

// XXX Can we make this const?
Expand Down
131 changes: 122 additions & 9 deletions Modules/clinic/_datetimemodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading