@@ -1949,6 +1949,7 @@ delta_str(PyDateTime_Delta *self)
19491949
19501950/* Pickle support, a simple use of __reduce__. */
19511951
1952+ /* __getstate__ isn't exposed */
19521953static PyObject *
19531954delta_getstate (PyDateTime_Delta * self )
19541955{
@@ -1979,9 +1980,6 @@ static PyMemberDef delta_members[] = {
19791980};
19801981
19811982static PyMethodDef delta_methods [] = {
1982- {"__getstate__" , (PyCFunction )delta_getstate , METH_NOARGS ,
1983- PyDoc_STR ("__getstate__() -> state" )},
1984-
19851983 {"__reduce__" , (PyCFunction )delta_reduce , METH_NOARGS ,
19861984 PyDoc_STR ("__reduce__() -> (cls, state)" )},
19871985
@@ -2525,6 +2523,7 @@ date_weekday(PyDateTime_Date *self)
25252523
25262524/* Pickle support, a simple use of __reduce__. */
25272525
2526+ /* __getstate__ isn't exposed */
25282527static PyObject *
25292528date_getstate (PyDateTime_Date * self )
25302529{
@@ -2591,9 +2590,6 @@ static PyMethodDef date_methods[] = {
25912590 {"replace" , (PyCFunction )date_replace , METH_KEYWORDS ,
25922591 PyDoc_STR ("Return date with new specified fields." )},
25932592
2594- {"__getstate__" , (PyCFunction )date_getstate , METH_NOARGS ,
2595- PyDoc_STR ("__getstate__() -> state" )},
2596-
25972593 {"__reduce__" , (PyCFunction )date_reduce , METH_NOARGS ,
25982594 PyDoc_STR ("__reduce__() -> (cls, state)" )},
25992595
@@ -3340,6 +3336,7 @@ time_nonzero(PyDateTime_Time *self)
33403336/* Let basestate be the non-tzinfo data string.
33413337 * If tzinfo is None, this returns (basestate,), else (basestate, tzinfo).
33423338 * So it's a tuple in any (non-error) case.
3339+ * __getstate__ isn't exposed.
33433340 */
33443341static PyObject *
33453342time_getstate (PyDateTime_Time * self )
@@ -3386,9 +3383,6 @@ static PyMethodDef time_methods[] = {
33863383 {"replace" , (PyCFunction )time_replace , METH_KEYWORDS ,
33873384 PyDoc_STR ("Return time with new specified fields." )},
33883385
3389- {"__getstate__" , (PyCFunction )time_getstate , METH_NOARGS ,
3390- PyDoc_STR ("__getstate__() -> state" )},
3391-
33923386 {"__reduce__" , (PyCFunction )time_reduce , METH_NOARGS ,
33933387 PyDoc_STR ("__reduce__() -> (cls, state)" )},
33943388
@@ -4340,6 +4334,7 @@ datetime_utctimetuple(PyDateTime_DateTime *self)
43404334/* Let basestate be the non-tzinfo data string.
43414335 * If tzinfo is None, this returns (basestate,), else (basestate, tzinfo).
43424336 * So it's a tuple in any (non-error) case.
4337+ * __getstate__ isn't exposed.
43434338 */
43444339static PyObject *
43454340datetime_getstate (PyDateTime_DateTime * self )
@@ -4431,9 +4426,6 @@ static PyMethodDef datetime_methods[] = {
44314426 {"astimezone" , (PyCFunction )datetime_astimezone , METH_KEYWORDS ,
44324427 PyDoc_STR ("tz -> convert to local time in new timezone tz\n" )},
44334428
4434- {"__getstate__" , (PyCFunction )datetime_getstate , METH_NOARGS ,
4435- PyDoc_STR ("__getstate__() -> state" )},
4436-
44374429 {"__reduce__" , (PyCFunction )datetime_reduce , METH_NOARGS ,
44384430 PyDoc_STR ("__reduce__() -> (cls, state)" )},
44394431
@@ -4530,46 +4522,6 @@ initdatetime(void)
45304522 if (PyType_Ready (& PyDateTime_TZInfoType ) < 0 )
45314523 return ;
45324524
4533- /* Make __getnewargs__ a true alias for __getstate__ */
4534- {
4535- PyObject * d , * f ;
4536-
4537- d = PyDateTime_DateType .tp_dict ;
4538- f = PyDict_GetItemString (d , "__getstate__" );
4539- if (f != NULL ) {
4540- if (PyDict_SetItemString (d , "__getnewargs__" , f ) < 0 )
4541- return ;
4542- }
4543-
4544- d = PyDateTime_DateTimeType .tp_dict ;
4545- f = PyDict_GetItemString (d , "__getstate__" );
4546- if (f != NULL ) {
4547- if (PyDict_SetItemString (d , "__getnewargs__" , f ) < 0 )
4548- return ;
4549- }
4550-
4551- d = PyDateTime_DeltaType .tp_dict ;
4552- f = PyDict_GetItemString (d , "__getstate__" );
4553- if (f != NULL ) {
4554- if (PyDict_SetItemString (d , "__getnewargs__" , f ) < 0 )
4555- return ;
4556- }
4557-
4558- d = PyDateTime_TimeType .tp_dict ;
4559- f = PyDict_GetItemString (d , "__getstate__" );
4560- if (f != NULL ) {
4561- if (PyDict_SetItemString (d , "__getnewargs__" , f ) < 0 )
4562- return ;
4563- }
4564-
4565- d = PyDateTime_TZInfoType .tp_dict ;
4566- f = PyDict_GetItemString (d , "__getstate__" );
4567- if (f != NULL ) {
4568- if (PyDict_SetItemString (d , "__getnewargs__" , f ) < 0 )
4569- return ;
4570- }
4571- }
4572-
45734525 /* timedelta values */
45744526 d = PyDateTime_DeltaType .tp_dict ;
45754527
0 commit comments