summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-293-20/+20
| | | | PyArg_ParseTuple() format string arguments as possible.
* Patch by Mozhe Zadka, for __contains__ (overloading 'in'). This addsGuido van Rossum2000-02-281-0/+56
| | | | | | an instance method instance_contains as sq_contains. It looks for __contains__ and if not found falls back to previous behaviour. Done.
* Patch by Mozhe Zadka, for __contains__ (overloading 'in'). ThisGuido van Rossum2000-02-281-1/+8
| | | | | patches PySequence_Contains() to check for a valid sq_contains field. More to follow.
* OKOK, Greg's right, I should've used the :name option in the argumentGuido van Rossum2000-02-241-9/+9
| | | | format strings.
* Made all list methods use PyArg_ParseTuple(), for more accurateGuido van Rossum2000-02-241-30/+29
| | | | | | | | diagnostics. *** INCOMPATIBLE CHANGE: This changes append(), remove(), index(), and *** count() to require exactly one argument -- previously, multiple *** arguments were silently assumed to be a tuple.
* Allow using long integers as arguments to PyObject_GetItem(), _SetItem(),Andrew M. Kuchling2000-02-231-1/+19
| | | | | | and _DelItem(). In sequence multiplication by a long, only call PyErr_Occurred() when the value returned is -1.
* dict_has_key(): Accept only one parameter. PR#210 reported byFred Drake2000-02-231-4/+4
| | | | Andreas Jung <ajung@sz-sb.de>.
* In response to one particular complaint on edu-sig, change some errorGuido van Rossum2000-02-151-3/+3
| | | | | | messages from "OverflowError: integer pow()" to "OverflowError: integer exponentiation". (Not that this takes care of the complaint in general that the error messages could be greatly improved. :-)
* Make multiplying a sequence by a long integer (5L * 'b') legalAndrew M. Kuchling2000-02-141-2/+13
|
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-2010-19/+21
| | | | compilation on NT Alpha. Mostly added casts etc.
* On Linux, one sometimes sees spurious errors after interruptingGuido van Rossum2000-01-121-0/+1
| | | | | previous output. Call clearerr() to prevent past errors affecting our ferror() test later, in PyObject_Print(). Suggested by Marc Lemburg.
* Implement the other easy thing: repr() of a float now uses %.17g,Guido van Rossum1999-12-231-6/+43
| | | | while str() uses %.12g as before.
* long_format(): Now takes a third parameter, addL; iff true, aFred Drake1999-12-231-9/+19
| | | | | | | | | | | | | | | trailing 'L' is appended to the representation, otherwise not. All existing call sites are modified to pass true for addL. Remove incorrect statement about external use of this function from elsewhere; it's static! long_str(): Handler for the tp_str slot in the type object. Identical to long_repr(), but passes false as the addL parameter of long_format().
* do_strip(): Fixed cut-and-paste error; this function should check forBarry Warsaw1999-12-151-3/+1
| | | | zero arguments (found by Marc Lemburg).
* Mainlining the string_methods branch. See branch revision logBarry Warsaw1999-10-124-120/+1199
| | | | messages for specific changes.
* Fix PR#66. Solution: add error checking around l_divmod() calls inGuido van Rossum1999-10-111-4/+18
| | | | long_pow().
* Fix for PR#98 (Adrian Eyre) -- in instancemethod_repr, the funcnameGuido van Rossum1999-10-111-1/+1
| | | | object is DECREFed too early.
* Patch by Tim Peters fixing PR#88:Guido van Rossum1999-09-271-1/+7
| | | | Integer division can crash under Windows.
* Patch by Tim Peters fixing PR#89:Guido van Rossum1999-09-271-0/+5
| | | | long(+/- infinity) returns nonsense.
* Patch by Mark Hammond to avoid certain header files on Windows/CE.Guido van Rossum1999-08-271-1/+10
|
* PyBuffer_New(): Raise ValueError if size is negative (the otherFred Drake1999-08-041-1/+6
| | | | | | | constructors didn't miss this). Raise MemoryError if malloc() fails, instead of just returning NULL.
* Mark Favas was quick to note that the last checkin divides by zeroGuido van Rossum1999-07-131-1/+1
| | | | | when n == 0... So divide by a->ob_size instead which was already tested for 0.
* Appropriate overflow checks so that things like sys.maxint*(1,) can'tGuido van Rossum1999-07-121-3/+13
| | | | dump core.
* When deallocating a list, DECREF the items from the end back to the start.Guido van Rossum1999-06-091-1/+6
|
* Fix bug discovered by John W. Shipman -- when the width of a formatGuido van Rossum1999-06-071-2/+4
| | | | | | | | specifier came from an int expression instead of a constant in the format, a negative width was truncated to zero instead of taken to mean the same as that negative constant plugged into the format. E.g. "(%*s)" % (-5, "foo") yielded "(foo)" while "(%-5s)" yields "(foo )". Now both yield the latter -- like sprintf() in C.
* Tim Peters writes:Guido van Rossum1999-05-061-7/+19
| | | | | | | | | | 1. Fixes float divmod so that the quotient it returns is always an integral value. 2. Fixes float % and float divmod so that the remainder always gets the right sign (the current code uses a "are the signs different?" test that doesn't work half the time <wink> when the product of the divisor and the remainder underflows to 0).
* Improve text of some error messages, as suggested by Sean Reifschneider.Guido van Rossum1999-04-191-2/+3
|
* casts for picky compilers.Guido van Rossum1999-04-101-1/+1
|
* Vladimir Marangozov contributed updated comments.Guido van Rossum1999-03-241-11/+8
|
* Folded long lines.Guido van Rossum1999-03-241-9/+18
|
* Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; ifGuido van Rossum1999-03-191-5/+17
| | | | | a block cannot be freed, add its free items back to the free list. This is necessary to avoid leaking when Python is reinitialized later.
* Fix a problem with Vladimir's PyInt_Fini code: clear the free list; ifGuido van Rossum1999-03-191-5/+27
| | | | | | a block cannot be freed, add its free items back to the free list, and add its valid ints back to the small_ints array if they are in range. This is necessary to avoid leaking when Python is reinitialized later.
* Added check for negative offset for PyBuffer_FromObject and check forGuido van Rossum1999-03-191-1/+13
| | | | negative size for PyBuffer_FromMemory. Greg Stein.
* Vladimir has restructured his code somewhat so that the blocks are nowGuido van Rossum1999-03-122-51/+97
| | | | | | | represented by an explicit structure. (There are still too many casts in the code, but that may be unavoidable.) Also added code so that with -vv it is very chatty about what it does.
* OK, try again. Vladimir gave me a fix for the alignment bus error,Guido van Rossum1999-03-121-7/+56
| | | | | so here's his patch again. This time it works (at least on Solaris, Linux and Irix).
* Alas, Vladimir's patch caused a bus error (probably doubleGuido van Rossum1999-03-111-56/+7
| | | | alignment?), and I didn't test it. Withdrawing it for now.
* Patch by Vladimir Marangoz to allow freeing of the allocated blocks ofGuido van Rossum1999-03-101-7/+56
| | | | floats on finalization.
* Patch by Vladimir Marangoz to allow freeing of the allocated blocks ofGuido van Rossum1999-03-101-15/+64
| | | | integers on finalization.
* Patch by Chris Petrilli to display the origin of a module in itsGuido van Rossum1999-02-151-3/+30
| | | | repr() -- either "(builtin)" or "from '<filename>'".
* Correct typo (Py_MethodDef doesn't exist). Reported by Uwe Zessin.Guido van Rossum1999-01-291-1/+1
|
* PyLong_FromString(): Nailed a small memory leak. In the str==startBarry Warsaw1999-01-271-0/+1
| | | | | test, we forgot that z is still pointing to a real live object. DECREF() it before returning.
* Ai! complex_nonzero() has && which should be ||, else decidedlyGuido van Rossum1999-01-251-1/+1
| | | | | non-zero things like 5j and complex(1,0) are considered to be zero/false. Tim Peters.
* Jim Ahlstrom patch: cutoff should be a long for machines with 16-bitGuido van Rossum1999-01-141-1/+1
| | | | | | ints. (In theory, other variables should be widened to long as well, but this won't ever be needed, since the len of a list is still an int.)
* Jim Ahlstrom patch: BIGCHUNK is too large for 16-bit int.Guido van Rossum1999-01-141-1/+5
|
* Patch by Charles Waldman -- remove unneeded and even harmful test forGuido van Rossum1999-01-101-10/+0
| | | | | float to the negative power (which is already and better done in floatobject.c.)
* Use 'xrange', not 'range', in error messages. Reported by Nathan Sullivan.Guido van Rossum1999-01-091-3/+3
|
* Need to include <sys/types.h> for off_t.Guido van Rossum1999-01-071-0/+2
|
* Changes for long file support by Steve Clift.Guido van Rossum1999-01-061-11/+53
| | | | (This also redoes my previous patch, but better.)
* Changes for long file support by Steve Clift.Guido van Rossum1999-01-061-18/+0
| | | | (Really: moved a bunch of defs to longobject.h.)
* Fix two places (seek and truncate) where a cascade of PyArg_ParseGuido van Rossum1999-01-041-11/+9
| | | | | calls was used instead of a single PyArg_ParseTuple call with an optional argument.