summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Conrad Huang points out that "if (0 < ch < 256)", while legal C,Guido van Rossum2000-04-061-1/+1
| | | | doesn't mean what the Python programmer thought...
* Fredrik Lundh: eliminate a MSVC compiler warning.Guido van Rossum2000-04-051-1/+1
|
* Marc-Andre's third try at this bulk patch seems to work (except thatGuido van Rossum2000-04-055-53/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | his copy of test_contains.py seems to be broken -- the lines he deleted were already absent). Checkin messages: New Unicode support for int(), float(), complex() and long(). - new APIs PyInt_FromUnicode() and PyLong_FromUnicode() - added support for Unicode to PyFloat_FromString() - new encoding API PyUnicode_EncodeDecimal() which converts Unicode to a decimal char* string (used in the above new APIs) - shortcuts for calls like int(<int object>) and float(<float obj>) - tests for all of the above Unicode compares and contains checks: - comparing Unicode and non-string types now works; TypeErrors are masked, all other errors such as ValueError during Unicode coercion are passed through (note that PyUnicode_Compare does not implement the masking -- PyObject_Compare does this) - contains now works for non-string types too; TypeErrors are masked and 0 returned; all other errors are passed through Better testing support for the standard codecs. Misc minor enhancements, such as an alias dbcs for the mbcs codec. Changes: - PyLong_FromString() now applies the same error checks as does PyInt_FromString(): trailing garbage is reported as error and not longer silently ignored. The only characters which may be trailing the digits are 'L' and 'l' -- these are still silently ignored. - string.ato?() now directly interface to int(), long() and float(). The error strings are now a little different, but the type still remains the same. These functions are now ready to get declared obsolete ;-) - PyNumber_Int() now also does a check for embedded NULL chars in the input string; PyNumber_Long() already did this (and still does) Followed by: Looks like I've gone a step too far there... (and test_contains.py seem to have a bug too). I've changed back to reporting all errors in PyUnicode_Contains() and added a few more test cases to test_contains.py (plus corrected the join() NameError).
* Some blank lines.Guido van Rossum2000-03-311-0/+3
|
* Add PyDict_Copy() function to C API for dicts. It returns a newJeremy Hylton2000-03-301-1/+15
| | | | dictionary that contains the same key/value pairs as p.
* MBCS codecs. (Win32 only.) By Mark Hammond.Guido van Rossum2000-03-281-0/+59
|
* Christian Tismer:Guido van Rossum2000-03-251-2/+8
| | | | | | Added "better safe than sorry" patch to the new trashcan code in object.c, to ensure that tstate is not touched when it might be undefined.
* On 17-Mar-2000, Marc-Andre Lemburg said:Barry Warsaw2000-03-202-23/+26
| | | | | | | | | | | | | Attached you find an update of the Unicode implementation. The patch is against the current CVS version. I would appreciate if someone with CVS checkin permissions could check the changes in. The patch contains all bugs and patches sent this week and also fixes a leak in the codecs code and a bug in the free list code for Unicode objects (which only shows up when compiling Python with Py_DEBUG; thanks to MarkH for spotting this one).
* Checking in the new, improve file.writelines() code.Guido van Rossum2000-03-131-24/+78
| | | | | | This (1) avoids thread unsafety whereby another thread could zap the list while we were using it, and (2) now supports writing arbitrary sequences of strings.
* Christian Tismer's "trashcan" patch:Guido van Rossum2000-03-135-1/+55
| | | | | | | | Added wrapping macros to dictobject.c, listobject.c, tupleobject.c, frameobject.c, traceback.c that safely prevends core dumps on stack overflow. Macros and functions in object.c, object.h. The method is an "elevator destructor" that turns cascading deletes into tail recursive behavior when some limit is hit.
* Fix typo in replace() detected by Mark Hammond and fixed by Marc-Andre.Guido van Rossum2000-03-131-2/+4
|
* Add sq_contains implementation.Guido van Rossum2000-03-131-0/+44
|
* Added Christian Tismer's patch to allow list.append(a,b,c) back --Guido van Rossum2000-03-131-4/+18
| | | | | with a twist: you have to define NO_STRICT_LIST_APPEND manually to enable multi-arg append().
* Marc-AAndre Lemburg: add new unicode filesGuido van Rossum2000-03-101-2/+6
|
* Many changes for Unicode, by Marc-Andre Lemburg.Guido van Rossum2000-03-106-197/+942
|
* Unicode implementation by Marc-Andre Lemburg based on original code byGuido van Rossum2000-03-101-0/+4440
| | | | Fredrik Lundh.
* Unicode character type helpers, written by Marc-Andre Lemburg.Guido van Rossum2000-03-101-0/+5043
|
* Patch by Moshe Zadka: remove the string special case inGuido van Rossum2000-03-071-18/+0
| | | | | PySequence_Contains() now that string objects have this code in their tp_contains.
* Patch by Moshe Zadka: move the string special case from abstract.cGuido van Rossum2000-03-071-0/+22
| | | | | | here. [Patch modified by GvR to keep the original exception.]
* string_join(): Fix memory leaks discovered by Charles Waldman (and aBarry Warsaw2000-03-061-5/+15
| | | | few other paths through the function that leaked).
* 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
|