summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.)
* Remove prototype for PyOS_strtol -- Chris Herborth.Guido van Rossum1998-12-101-1/+0
|
* Believe it or not, Solaris 2.6 strtod() can move the end pointerGuido van Rossum1998-10-011-1/+6
| | | | | *beyond* the null byte at the end of the input string, when the input is inf(inity). Discovered by Greg Ward.
* Better error messages when a sequence is indexed with a non-integer.Guido van Rossum1998-08-131-6/+17
| | | | | | | Previously, this said "unsubscriptable object"; in 1.5.1, the reverse problem existed, where None[''] would complain about a non-integer index. This fix does the right thing in all cases (for get, set and del item).
* Better error messages when raising ValueError for int and longGuido van Rossum1998-08-041-6/+9
| | | | | literals. (The previous version of this code would not show the offending input, even though there was code that attempted this.)
* Add special case to PySequence_List() so that list() of a list isGuido van Rossum1998-07-101-0/+6
| | | | | | faster (using PyList_GetSlice()). Also added a test for a NULL argument, as with PySequence_Tuple(). (Hmm... Better names for these two would be PyList_FromSequence() and PyTuple_FromSequence(). Oh well.)
* Changed PySequence_List() and PySequence_Tuple() to supportGuido van Rossum1998-07-101-27/+38
| | | | | | | | | "indefinite length" sequences. These should still have a length, but the length is only used as a hint -- the actual length of the sequence is determined by the item that raises IndexError, which may be either smaller or larger than what len() returns. (This is a novelty; map(), filter() and reduce() only allow the actual length to be larger than what len() returns, not shorter. I'll fix that shortly.)
* Fix the tests for various anomalies in the string-to-numbersGuido van Rossum1998-06-221-12/+8
| | | | | | conversions. Formerly, for example, int('-') would return 0 instead of raising ValueError, and int(' 0') would raise ValueError (complaining about a null byte!) instead of 0...
* Fix a whole bunch of error return NULL that should be return -1.Guido van Rossum1998-05-291-5/+5
|
* Uses PyErr_ExceptionMatches() instead of comparing PyErr_Occurred().Guido van Rossum1998-05-281-1/+1
|
* Address some gcc -Wall warnings (e.g. include <ctype.h>).Guido van Rossum1998-05-221-29/+54
| | | | | | | Make sure that no tp_as_numbers->nb_<whatever> function is called without checking for a NULL pointer. Marc-Andre Lemburg will love it! (Except that he's just rewritten all this code for a different approach to coercions ;-( )
* Completely reformatted, standardizing indentation as well asGuido van Rossum1998-05-221-582/+900
| | | | | | | | | | | | | | | | programming style. Recoded many routines to incorporate better error checking, and/or better versions of the same function found elsewhere (e.g. bltinmodule.c or ceval.c). In particular, Py_Number_{Int,Long,Float}() now convert from strings, just like the built-in functions int(), long() and float(). Sequences and mappings are now safe to have NULL function pointers anywhere in their tp_as_sequence or tp_as_mapping fields. (A few places in other files need to be checked in too.) Renamed PySequence_In() to PySequence_Contains().
* This was the reason a numeric array to a real power was not working.Guido van Rossum1998-04-031-1/+2
|
* Renamed a local variable from 'PyCFunction' (which is also a typedefGuido van Rossum1997-05-201-6/+6
| | | | in methodobject.h) to 'func'. /bin/cc on SunOS 4.x didn't grok this.
* Fix reversed test for failure in PySequence_List() and PySequence_Tuple().Guido van Rossum1997-05-141-2/+2
| | | | This broke cPickle.
* Quickly renamed the last directory.Guido van Rossum1997-05-021-11/+11
|
* Several fixes reported by jim F.Guido van Rossum1997-04-021-31/+28
|
* PySequence_Index(): set exception when object is not found inBarry Warsaw1996-12-181-0/+1
| | | | | | | | | sequence, otherwise operator.indexOf([4, 3, 2, 1], 9) would raise a SystemError! Note: it might be wise to double check all these functions. I haven't done that yet.
* Added missing PySequence_List.Guido van Rossum1996-12-051-15/+44
| | | | | Correct typo in error msg (expec[t]ed). Make gcc -Wall happy.
* Make Py_ReturnNullError() statis as it should be.Guido van Rossum1996-11-111-1/+1
|
* Only call sq_length in Sequence_GetItem for negative index.Guido van Rossum1996-11-091-4/+6
|
* correct typo in return variable for PySequence_Index()Guido van Rossum1996-11-061-1/+1
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Fix subtle bug detected by Jim F.Guido van Rossum1996-09-301-1/+1
|
* Added PyObject_DelItem and PySequence_Del{Item,Slice}.Guido van Rossum1996-08-211-0/+61
|
* adapted to K&R CGuido van Rossum1995-09-181-35/+89
|
* Generic Abstract Object InterfaceGuido van Rossum1995-07-181-0/+972