[Patches] [Patch #100884] arraymodule: adding count, extend, index, pop, remove

noreply@sourceforge.net noreply@sourceforge.net
Mon, 31 Jul 2000 09:31:18 -0700


Patch #100884 has been updated. 

Project: 
Category: None
Status: Open
Summary: arraymodule: adding count, extend, index, pop, remove

Follow-Ups:

Date: 2000-Jul-31 01:45
By: nowonder

Comment:
needs reviewing. includes test and documentation update. works fine on all tests.
-------------------------------------------------------

Date: 2000-Jul-31 06:30
By: gvanrossum

Comment:
Rejected: the idea is good, but the code buggy:

- getarrayitem() returns a new reference, so you must DECREF it after using the value (except the one place where you INCREF it unnecessarily)

- PyErr_BadArgument() is a poor diagnostic for extend() with an array of the wrong kind.

Please fix the patch and resubmit!
-------------------------------------------------------

Date: 2000-Jul-31 06:37
By: fdrake

Comment:
The documentation update looks fine to me.
The methods in the C module should use PyArg_ParseTuple() instead of PyArg_Parse(); there's rarely a good reason to use the older version, and the _ParseTuple() version allows the function nam e to be included in the error messages.
(Plus Guido's comments need to be addressed.)
-------------------------------------------------------

Date: 2000-Jul-31 09:08
By: nowonder

Comment:
changed _parse to _parsetuple

hopefully fixed refcounting (my first try at that)
-------------------------------------------------------

Date: 2000-Jul-31 09:31
By: fdrake

Comment:
Please don't hard code magic numbers in the methods table; use METH_VARARGS instead of 1.

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=100884&group_id=5470