summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-261-3/+0
| | | | | | | | Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
* arraymodule: Fix SF bug 113960.Tim Peters2000-09-161-18/+23
| | | | | | | | | | | | | | reverse() didn't work at all due to bad arg check. Fixed that. Added Brad Chapman to ACKS file, as the proud new owner of two implicitly copyrighted lines of Python source code <wink>. Repaired buffer_info's total lack of arg-checking. Replaced memmove by memcpy in reverse() guts, as memmove is often slower and the memory areas are guaranteed disjoint. Replaced poke-and-hope unchecked decl of tmp buffer size by assert-checked larger tmp buffer. Got rid of inconsistent spaces before open paren in docstrings. Added reverse() sanity tests to test_array.py.
* General cleanup in preparation for a bugfix: removed unused code, uselessTim Peters2000-09-101-65/+27
| | | | | | | | declarations, added some comments where I had to think too hard to understand what was happening, and changed the primary internal get/set functions to assert they're passed objects of the correct type instead of doing runtime tests for that (it's an internal error that "should never happen", so it's good enough to check it only in the debug build).
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Peter Schneider-Kamp <nowonder@nowonder.de>:Fred Drake2000-08-311-3/+1
| | | | | | Remove some of GCC's warning in -Wstrict-prototypes mode. This closes SourceForge patch #101342.
* Use safer comparisons (only matters when sizeof(int) != sizeof(size_t)). freadTrent Mick2000-08-121-2/+2
| | | | | and fwrite return size_t, so it is safer to cast up to the largest type for the comparison. I believe the cast is required at all to remove compiler warnings.
* Removed decl of unreferenced vrbl.Tim Peters2000-08-011-1/+0
|
* replaced PyArgs_Parse by PyArgs_ParseTuplePeter Schneider-Kamp2000-07-311-34/+39
| | | | changed error messages for extend method from "append" to "extend"
* added count, extend, index, pop and remove to arraymodulePeter Schneider-Kamp2000-07-311-72/+168
|
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-1/+1
| | | | | | | | | | | | | | | | | | and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
* ANSI-fication (got lost in the deep seas of source forge <wink>)Peter Schneider-Kamp2000-07-131-195/+60
|
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-8/+8
|
* Jack Jansen, Mac patch:Guido van Rossum2000-07-011-0/+3
| | | | Include limits.h if we have it.
* In b_setitem(), instead of the platform dependent CHAR_MIN andGuido van Rossum2000-07-011-2/+2
| | | | | | | | | | | | | CHAR_MAX, use hardcoded -128 and 127. This may seem strange, unless you realize that we're talking about signed bytes here! Bytes are always 8 bits and 2's complement. CHAR_MIN and CHAR_MAX are properties of the char data type, which is guaranteed to hold at least 8 bits anyway. Otherwise you'd get failing tests on platforms where unsigned char is the default (e.g. AIX). Thanks, Vladimir Marangozov, for finding this nit!
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick: use size_t instead of int where appropriate (inGuido van Rossum2000-06-281-2/+2
| | | | fromfile(), to hold fread() result.)
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-281-10/+95
| | | | | | | | | | | | | | | | | | | | | | | | | The cause: Relatively recent (last month) patches to getargs.c added overflow checking to the PyArg_Parse*() integral formatters thereby restricting 'b' to unsigned char value and 'h','i', and 'l' to signed integral values (i.e. if the incoming value is outside of the specified bounds you get an OverflowError, previous it silently overflowed). The problem: This broke the array module (as Fredrik pointed out) because *its* formatters relied on the loose allowance of signed and unsigned ranges being able to pass through PyArg_Parse*()'s formatters. The fix: This patch fixes the array module to work with the more strict bounds checking now in PyArg_Parse*(). How: If the type signature of a formatter in the arraymodule exactly matches one in PyArg_Parse*(), then use that directly. If there is no equivalent type signature in PyArg_Parse*() (e.g. there is no unsigned int formatter in PyArg_Parse*()), then use the next one up and do some extra bounds checking in the array module. This partially closes SourceForge patch #100506.
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2000-06-011-3/+8
| | | | | Removed PyErr_BadArgument() calls and replaced them with more useful error messages.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-6/+3
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* Patch from Paul Sokolovsky <Paul.Sokolovsky@technologist.com>:Fred Drake2000-02-041-1/+3
| | | | | Attached is patch (against 1.5.2 release) to allow some modules to be buildable as pyd's (usual &PyType_Type stuff).
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-1/+1
| | | | compilation on NT Alpha. Mostly added casts etc.
* Correct the docstring for byteswap(); error noted by Bernhard ReiterFred Drake1999-12-031-4/+9
| | | | | | | <bernhard@uwm.edu>. Added a check that no parameters were passed to byteswap(); previously allowed any parameters you happened to pass.
* Tiny patch by Mark Hammond to avoid sys/types.h if we don't have itGuido van Rossum1999-08-271-2/+4
| | | | (for Windows/CE).
* Use an unsigned cast to avoid a warning in VC++.Guido van Rossum1999-03-191-1/+2
|
* Carefully check for overflow when allocating the memory for fromfileGuido van Rossum1999-02-231-1/+8
| | | | | -- someone tried to pass in sys.maxint and got bitten by the bogus calculations.
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* No need to issue a fatal error if the PyDict_SetItemString fails; theGuido van Rossum1998-10-141-3/+2
| | | | caller (in import.c) will test for errors and take appropriate action.
* ACK! There was still an unescaped newline in a docstring.Guido van Rossum1998-10-141-1/+1
|
* Doc strings by Chris Petrilli.Guido van Rossum1998-10-131-42/+177
|
* Added buffer_info() method that returns address and length in bytes ofGuido van Rossum1997-08-121-0/+10
| | | | the buffer used to hold the array -- for dangerous low-level I/O.
* array_type -> ArrayTypeGuido van Rossum1997-06-021-2/+2
|
* PyObject_Compare can raise an exception now.Guido van Rossum1997-05-231-4/+4
|