summaryrefslogtreecommitdiffstats
path: root/Modules/_datetimemodule.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-05-31 02:13:39 (GMT)
committerBenjamin Peterson <benjamin@python.org>2019-05-31 02:13:39 (GMT)
commit530f506ac91338b55cf2be71b1cdf50cb077512f (patch)
tree35e5a5e077198451bdfb79d2ce18e855b02d2f28 /Modules/_datetimemodule.c
parent4c23aff065fb28aba789a211937a2af974842110 (diff)
downloadcpython-530f506ac91338b55cf2be71b1cdf50cb077512f.zip
cpython-530f506ac91338b55cf2be71b1cdf50cb077512f.tar.gz
cpython-530f506ac91338b55cf2be71b1cdf50cb077512f.tar.bz2
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
Diffstat (limited to 'Modules/_datetimemodule.c')
-rw-r--r--Modules/_datetimemodule.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 83e43a2..4d3562c 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -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 */