Re: [Python-checkins] CVS: python/dist/src/Objects dictobject.c,2.65,2.66

On Thu, Nov 30, 2000 at 04:31:07AM -0800, Moshe Zadka wrote:
... *** dictobject.c 2000/09/01 23:29:27 2.65 --- dictobject.c 2000/11/30 12:31:00 2.66
*** 710,713 **** --- 710,782 ----
static PyObject *
- dict_firstkey(register dictobject *mp, PyObject *args)
- {
- register int i;
- if (!PyArg_NoArgs(args))
return NULL;
PyArg_NoArgs() is deprecated because you cannot specify the method name. The code should be:
if (!PyArg_ParseTuple(args, ":firstkey")) return NULL;
(same in the next two funcs)
...
if (mp->ma_table[i].me_value != NULL) {
PyObject *key = mp->ma_table[i].me_key;
PyObject *value = mp->ma_table[i].me_value;
PyObject *item = PyTuple_New(2);
if (item == NULL) {
return NULL;
}
Py_INCREF(key);
PyTuple_SetItem(item, 0, key);
Py_INCREF(value);
PyTuple_SetItem(item, 1, value);
These can be PyTuple_SET_ITEM() since you know you have a tuple.
Cheers, -g

Let's back out these changes and put them in a patch. There is still a lot of discussion going on. The patch itself has some small problems. And it is incomplete -- no test cases, no documentation, etc.
Jeremy

Let's back out these changes and put them in a patch. There is still a lot of discussion going on. The patch itself has some small problems. And it is incomplete -- no test cases, no documentation, etc.
Agreed. Sorry, Moshe. Can you do this yourself? Don't try to be clever with cvs admin, just use -j.
--Guido van Rossum (home page: http://www.python.org/~guido/)

On Thu, 30 Nov 2000, Guido van Rossum wrote:
Let's back out these changes and put them in a patch. There is still a lot of discussion going on. The patch itself has some small problems. And it is incomplete -- no test cases, no documentation, etc.
Agreed. Sorry, Moshe. Can you do this yourself? Don't try to be clever with cvs admin, just use -j.
OK, I'll try. If CVS gets the best of me, I'll ask for your help... -- Moshe Zadka moshez@math.huji.ac.il -- 95855124 http://advogato.org/person/moshez

On Thu, Nov 30, 2000 at 08:55:56PM +0200, Moshe Zadka wrote:
On Thu, 30 Nov 2000, Guido van Rossum wrote:
Let's back out these changes and put them in a patch. There is still a lot of discussion going on. The patch itself has some small problems. And it is incomplete -- no test cases, no documentation, etc.
Agreed. Sorry, Moshe. Can you do this yourself? Don't try to be clever with cvs admin, just use -j.
OK, I'll try. If CVS gets the best of me, I'll ask for your help...
Not sure what -j does, but you can just do a reverse diff. For example:
$ cvs diff -r2.66 -r2.65 dictobject.c > reverse.patch
Apply the patch to your working copy, then check it in.
Cheers, -g

On Thu, Nov 30, 2000 at 11:12:54AM -0800, Greg Stein wrote:
Not sure what -j does, but you can just do a reverse diff. For example:
$ cvs diff -r2.66 -r2.65 dictobject.c > reverse.patch
-j basically does the work for you; you could do: $ cvs update -j2.66 -j2.65 dictobject.c
And then do a commit. See the CVS book: http://cvsbook.red-bean.com/cvsbook.html#Examining%20And%20Reverting%20Chang...
--amk
participants (5)
-
Andrew Kuchling
-
Greg Stein
-
Guido van Rossum
-
Jeremy Hylton
-
Moshe Zadka