summaryrefslogtreecommitdiff
path: root/Modules/arraymodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge p3yk branch with the trunk up to revision 45595. This breaks a fairThomas Wouters2006-04-211-6/+7
| | | | | | | | | | | | | | | | | | | | number of tests, all because of the codecs/_multibytecodecs issue described here (it's not a Py3K issue, just something Py3K discovers): http://mail.python.org/pipermail/python-dev/2006-April/064051.html Hye-Shik Chang promised to look for a fix, so no need to fix it here. The tests that are expected to break are: test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecs test_multibytecodec This merge fixes an actual test failure (test_weakref) in this branch, though, so I believe merging is the right thing to do anyway.
* Checking in the code for PEP 357.Guido van Rossum2006-03-071-18/+11
| | | | | | This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).
* SF #1444030: Fix several potential defects found by Coverity.Hye-Shik Chang2006-03-071-4/+7
| | | | (reviewed by Neal Norwitz)
* Convert array.array.insert to use Py_ssize_t (like the rest already does.)Thomas Wouters2006-02-271-2/+2
|
* Bug #1432350: arrayobject should use PyObject_VAR_HEADGeorg Brandl2006-02-171-2/+1
|
* Use correct format specifier for Py_ssize_t variable to PyArg_ParseTuple().Thomas Wouters2006-02-161-1/+1
|
* Use Py_ssize_t for counts and sizes.Martin v. Löwis2006-02-161-16/+13
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-94/+99
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Disallow keyword arguments for type constructors that don't use them.Georg Brandl2005-08-261-12/+3
| | | | (fixes bug #1119418)
* SF #1085304: Make array.array pickle-ableRaymond Hettinger2004-12-161-0/+25
|
* SF feature request #992967: array.array objects should support sequences.Raymond Hettinger2004-08-291-6/+20
| | | | Made the constructor accept general iterables.
* Add weakref support to array.array and file objects.Raymond Hettinger2004-05-311-2/+7
|
* SF feature request #686323: Minor array module enhancementsRaymond Hettinger2004-03-141-9/+34
| | | | | | | array.extend() now accepts iterable arguments implements as a series of appends. Besides being a user convenience and matching the behavior for lists, this the saves memory and cycles that would be used to create a temporary array object.
* Update the array overallocation scheme to match the approach used forRaymond Hettinger2004-03-141-61/+76
| | | | | | | | lists. Speeds append() operations and reduces memory requirements (because of more conservative overallocation). Paves the way for the feature request for array.extend() to support arbitrary iterable arguments.
* SF bug #910986: copy.copy fails for array.arrayRaymond Hettinger2004-03-131-0/+15
| | | | Added support for the copy module.
* Simplify and speedup uses of Py_BuildValue():Raymond Hettinger2003-10-121-1/+1
| | | | | | * Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a)
* SF bug #782369: Massive memory leak in array moduleRaymond Hettinger2003-08-051-2/+7
| | | | | | | | Fixed leak caused by switching from PyList_GetItem to PySequence_GetItem. Added missing NULL check. Clarified code by converting an "if" to an "else if". Will backport to 2.3.
* All calls to getarrayitem() (which is static) are done either in loopsWalter Dörwald2003-05-231-4/+1
| | | | | over the size of the array, or the callers check the index bounds themselves, so the index check never failed => Replace it with an assert().
* Fix array.array.insert(), so that it treats negative indices asWalter Dörwald2003-05-181-2/+5
| | | | | being relative to the end of the array, just like list.insert() does. This closes SF bug #739313.
* SF 686323: Minor array module enhancementsRaymond Hettinger2003-04-241-4/+6
| | | | Allows use of tuples for the initializer.
* SF Patch 685051: fix for 680789: reprs in arraymoduleRaymond Hettinger2003-04-231-30/+15
| | | | | | | | | | | | | (contributed by logistix; substantially reworked by rhettinger). To create a representation of non-string arrays, array_repr() was starting with a base Python string object and repeatedly using += to concatenate the representation of individual objects. Logistix had the idea to convert to an intermediate tuple form and then join it all at once. I took advantage of existing tools and formed a list with array_tolist() and got its representation through PyObject_Repr(v) which already has a fast implementation for lists.
* Renamed PyObject_GenericGetIter to PyObject_SelfIterRaymond Hettinger2003-03-171-1/+1
| | | | | | to more accurately describe what the function does. Suggested by Thomas Wouters.
* Created PyObject_GenericGetIter().Raymond Hettinger2003-03-171-8/+1
| | | | Factors out the common case of returning self.
* SF patch #687598, array.append is sloooowNeal Norwitz2003-02-241-2/+47
| | | | This improves speed by about 5.6% for me.
* Patch #676837: Cygwin array module patchJason Tishler2003-02-101-1/+2
| | | | | The attached patch enables the array module to build cleanly under Cygwin again.
* SF patch #662433: Fill arraymodule's tp_iter and sq_contains slotsRaymond Hettinger2003-01-071-2/+121
|
* Patch #661760: Cygwin auto-import module patchJason Tishler2003-01-061-8/+3
| | | | | | | | | | | | The attached patch enables shared extension modules to build cleanly under Cygwin without moving the static initialization of certain function pointers (i.e., ones exported from the Python DLL core) to a module initialization function. Additionally, this patch fixes the modules that have been changed in the past to accommodate Cygwin.
* SF patch 660559: Use METH_O and METH_NOARGS where possibleRaymond Hettinger2003-01-031-67/+32
| | | | | Simplify code and speed access by using PyArg_UnpackTuple, METH_O and METH_NOARGS in three modules that can benefit from it.
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Fix forMichael W. Hudson2002-07-291-6/+7
| | | | | | [ 587875 ] crash on deleting extended slice The array code got simpler, always a good thing!
* Removed more stray instances of statichere, but left _sre.c alone.Tim Peters2002-07-171-1/+1
|
* staticforward bites the dust.Jeremy Hylton2002-07-171-1/+1
| | | | | | | | | | | | | | | The staticforward define was needed to support certain broken C compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the static keyword when it was used with a forward declaration of a static initialized structure. Standard C allows the forward declaration with static, and we've decided to stop catering to broken C compilers. (In fact, we expect that the compilers are all fixed eight years later.) I'm leaving staticforward and statichere defined in object.h as static. This is only for backwards compatibility with C extensions that might still use it. XXX I haven't updated the documentation.
* Fix the bug described inMichael W. Hudson2002-06-191-1/+174
| | | | | | | | | http://mail.python.org/pipermail/python-dev/2002-June/025461.html with test cases. Also includes extended slice support for arrays, which I thought I'd already checked in but obviously not.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-40/+40
|
* array_tounicode isn't defined in --disable-unicode builds...Michael W. Hudson2002-05-131-0/+4
| | | | | I have a patch to make the test work too, but it's not pretty so I'll submit it to sf.
* Indicate delayed initialization of slots. Suggested by tim.one.Martin v. Löwis2002-05-021-3/+5
|
* Patch #551009: Initialize array type dynamically.Martin v. Löwis2002-05-021-3/+6
|
* PyObject_Del can now be used as a function designator.Neil Schemenauer2002-04-121-1/+1
|
* Use the PyModule_*() API instead of manipulating the module dictionaryFred Drake2002-04-011-4/+6
| | | | directly.
* Remove tp_print.Martin v. Löwis2002-03-041-34/+1
|
* Patch 520694: arraymodule.c improvements:Martin v. Löwis2002-03-011-107/+316
| | | | | | - make array.array a type - add Py_UNICODE arrays - support +=, *=
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-081-1/+1
| | | | | | | | | | | | | type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
* sprintf -> PyOS_snprintf in some "obviously safe" cases.Tim Peters2001-11-281-3/+4
| | | | | Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
* Fix buffer_info() docstring to match reality. See SF bug #444842.Guido van Rossum2001-07-271-1/+3
|
* Make it possible to find the use of tp_as_buffer here with a global search.Tim Peters2001-06-051-1/+1
| | | | (Just a change to a comment)
* Correct one-line typo, reported by yole @ SF, bug 130077.Guido van Rossum2001-01-251-1/+1
|
* The array type was missing the Py_TPFLAGS_DEFAULT initializer for theGuido van Rossum2001-01-241-1/+1
| | | | | tp_flags. This will become important when I introduce Py_TPFLAGS_HAVE_RICHCOMPARE (as I should have!).
* Same treatment as listobject.c:Guido van Rossum2001-01-181-67/+156
| | | | | | | | | | | | - In count(), remove(), index(): call RichCompare(Py_EQ). - Get rid of array_compare(), in favor of new array_richcompare() (a near clone of list_compare()). - Aligned items in array_methods initializer and comments for type struct initializer. - Folded a few long lines.
* Fix for SF bug 117402, crashes on str(array) and repr(array). This was anTim Peters2000-11-101-3/+5
| | | | | unfortunate consequence of somebody switching from PyArg_Parse to PyArg_ParseTuple but without changing the argument from a NULL to a tuple.