[Python-checkins] python/nondist/sandbox/datetime obj_delta.c,1.16,1.17
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Mon, 02 Dec 2002 12:43:03 -0800
- Previous message: [Python-checkins] python/nondist/sandbox/datetime datetime.c,1.32,1.33 obj_date.c,1.13,1.14 obj_datetime.c,1.7,1.8 test_both.py,1.17,1.18
- Next message: [Python-checkins] python/nondist/sandbox/datetime obj_delta.c,1.17,1.18 test_both.py,1.18,1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv10627
Modified Files:
obj_delta.c
Log Message:
delta_reduce(): Fred pointed out a niftier way to get an empty tuple
embedded in the result tuple.
Index: obj_delta.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_delta.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** obj_delta.c 2 Dec 2002 18:10:33 -0000 1.16
--- obj_delta.c 2 Dec 2002 20:42:53 -0000 1.17
***************
*** 580,595 ****
{
PyObject* result = NULL;
! PyObject* state;
- state = delta_getstate(self);
if (state != NULL) {
! PyObject *emptytuple = PyTuple_New(0);
! if (emptytuple != NULL) {
! result = Py_BuildValue("OOO",
! self->ob_type,
! emptytuple,
! state);
! Py_DECREF(emptytuple);
! }
Py_DECREF(state);
}
--- 580,590 ----
{
PyObject* result = NULL;
! PyObject* state = delta_getstate(self);
if (state != NULL) {
! /* The funky "()" in the format string creates an empty
! * tuple as the 2nd component of the result 3-tuple.
! */
! result = Py_BuildValue("O()O", self->ob_type, state);
Py_DECREF(state);
}
- Previous message: [Python-checkins] python/nondist/sandbox/datetime datetime.c,1.32,1.33 obj_date.c,1.13,1.14 obj_datetime.c,1.7,1.8 test_both.py,1.17,1.18
- Next message: [Python-checkins] python/nondist/sandbox/datetime obj_delta.c,1.17,1.18 test_both.py,1.18,1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]