mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
This commit is contained in:
parent
4c23aff065
commit
530f506ac9
109 changed files with 516 additions and 518 deletions
|
@ -1704,8 +1704,7 @@ build_struct_time(int y, int m, int d, int hh, int mm, int ss, int dstflag)
|
|||
* Miscellaneous helpers.
|
||||
*/
|
||||
|
||||
/* For various reasons, we need to use tp_richcompare instead of tp_reserved.
|
||||
* The comparisons here all most naturally compute a cmp()-like result.
|
||||
/* The comparisons here all most naturally compute a cmp()-like result.
|
||||
* This little helper turns that into a bool result for rich comparisons.
|
||||
*/
|
||||
static PyObject *
|
||||
|
@ -2720,10 +2719,10 @@ static PyTypeObject PyDateTime_DeltaType = {
|
|||
sizeof(PyDateTime_Delta), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_vectorcall_offset */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_as_async */
|
||||
(reprfunc)delta_repr, /* tp_repr */
|
||||
&delta_as_number, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
|
@ -3431,10 +3430,10 @@ static PyTypeObject PyDateTime_DateType = {
|
|||
sizeof(PyDateTime_Date), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_vectorcall_offset */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_as_async */
|
||||
(reprfunc)date_repr, /* tp_repr */
|
||||
&date_as_number, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
|
@ -3681,10 +3680,10 @@ static PyTypeObject PyDateTime_TZInfoType = {
|
|||
sizeof(PyDateTime_TZInfo), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_vectorcall_offset */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_as_async */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
|
@ -3920,10 +3919,10 @@ static PyTypeObject PyDateTime_TimeZoneType = {
|
|||
sizeof(PyDateTime_TimeZone), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)timezone_dealloc, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_vectorcall_offset */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_as_async */
|
||||
(reprfunc)timezone_repr, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
|
@ -4583,10 +4582,10 @@ static PyTypeObject PyDateTime_TimeType = {
|
|||
sizeof(PyDateTime_Time), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)time_dealloc, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_vectorcall_offset */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_as_async */
|
||||
(reprfunc)time_repr, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
|
@ -6299,10 +6298,10 @@ static PyTypeObject PyDateTime_DateTimeType = {
|
|||
sizeof(PyDateTime_DateTime), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)datetime_dealloc, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_vectorcall_offset */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_as_async */
|
||||
(reprfunc)datetime_repr, /* tp_repr */
|
||||
&datetime_as_number, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue