[Python-checkins] python/nondist/sandbox/datetime obj_delta.c,1.14,1.15 test_both.py,1.15,1.16

Tim Peters tim.one@comcast.net
Mon, 02 Dec 2002 14:47:04 -0500


> > + 		PyObject *emptytuple = PyTuple_New(0);
> > + 		if (emptytuple != NULL) {
> > + 			result = Py_BuildValue("OOO",
> > + 					       self->ob_type,
> > + 					       emptytuple,
> > + 					       state);
> > + 			Py_DECREF(emptytuple);
> > + 		}
> > + 		Py_DECREF(state);

[Neal Norwitz]
> What is the purpose of emptytuple here?

The docs for __reduce__ say the 2nd component of the return value must be a
tuple or None, and the use of None is deprecated.  Hence an empty tuple.

>  Could/should this code be:
>
>         result = Py_BuildValue(...);

I have no idea.  What does "..." mean?