summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Repaired illegal syntax most compilers probably let slide (but MSVCTim Peters2002-11-141-1/+1
| | | | treats as a fatal error).
* Use the new C3 MRO algorithm, implemented by Samuele Pedroni (SF patchGuido van Rossum2002-11-141-74/+105
| | | | | | | | | | 619475; also closing SF bug 618704). I tweaked his code a bit for style. This raises TypeError for MRO order disagreements, which is an improvement (previously these went undetected) but also a degradation: what if the order disagreement doesn't affect any method lookups? I don't think I care.
* Fix SF # 635969, No error "not all arguments converted"Neal Norwitz2002-11-122-2/+4
| | | | | | | | | When mwh added extended slicing, strings and unicode became mappings. Thus, dict was set which prevented an error when doing: newstr = 'format without a percent' % string_value This fix raises an exception again when there are no formats and % with a string value.
* SF patch 637176: list.sort crasherTim Peters2002-11-121-96/+29
| | | | | | | | | | | Armin Rigo's Draconian but effective fix for SF bug 453523: list.sort crasher slightly fiddled to catch more cases of list mutation. The dreaded internal "immutable list type" is gone! OTOH, if you look at a list *while* it's being sorted now, it will appear to be empty. Better than a core dump.
* Restore attribute access so that the following work again:Raymond Hettinger2002-11-071-1/+1
| | | | | dir(xrange(10)) xrange(10).__getitem__(4)
* Make int("...") return a long if an int would overflow.Walter Dörwald2002-11-062-19/+23
| | | | | | Also remove the 512 character limitation for int(u"...") and long(u"..."). This closes SF bug #629989.
* Handle really big steps in extended slices.Michael W. Hudson2002-11-061-5/+2
| | | | Fixes a test failure on 64 bit platforms (I hope).
* Use PyOS_snprintf() instead of sprintf and wrap the long lineNeal Norwitz2002-11-051-2/+4
|
* Use PyList_CheckExact and PyTuple_CheckExact for checking whetherMichael W. Hudson2002-11-051-1/+1
| | | | PySequence_Fast needs to do anything siginificant.
* This is Alex Martelli's patchMichael W. Hudson2002-11-051-9/+12
| | | | | | [ 633870 ] allow any seq assignment to a list slice plus a very silly little test case of my own.
* Some days, I think my comment ofMichael W. Hudson2002-11-051-6/+12
| | | | | | | | | | | | /* this is harder to get right than you might think */ angered some God somewhere. After noticing >>> range(5000000)[slice(96360, None, 439)] [] I found that my cute test for the slice being empty failed due to overflow. Fixed, and added simple test (not the above!).
* Since properties are supported here, is possible thatGuido van Rossum2002-10-291-13/+12
| | | | | | | instance_getattr2() raises an exception. Fix all code that made this assumption. Backport candidate.
* Patch #627105: Document that SYSTEM_PAGE_SIZE really should not beMartin v. Löwis2002-10-261-1/+4
| | | | larger than the system page size.
* Fix for bug #626172: crash using unicode latin1 single charMarc-André Lemburg2002-10-231-3/+1
| | | | Python 2.2.3 candidate.
* Make lower/upper/title work for non-BMP characters.Martin v. Löwis2002-10-181-24/+15
|
* Fix SF # 624982, Potential AV in slot_sq_item, by Greg ChapmanNeal Norwitz2002-10-181-1/+5
| | | | Don't crash when getting value of a property raises an exception
* Update to Unicode 3.2 database.Martin v. Löwis2002-10-182-416/+960
|
* Fix (real! :-) memory leaks in half_cmp and half_binop.Guido van Rossum2002-10-181-1/+4
| | | | Perhaps found by NealN and valgrind. Will forward port.
* Sigh. That wasn't a memory leak, that was Guido committing beforeGuido van Rossum2002-10-181-5/+2
| | | | running tests. Withdraw 2.183 and its backport.
* Fix memory leak in add_subclass() found by NealN with valgrind.Guido van Rossum2002-10-181-2/+5
| | | | Will backport.
* Add n_unnamed_fields into the type.Martin v. Löwis2002-10-161-5/+15
|
* Add PyStructSequence_UnnamedField. Add stat_float_times.Martin v. Löwis2002-10-161-10/+19
| | | | Use integers in stat tuple, optionally floats in named fields.
* For some reason (probably cut and paste), __ipow__ for new-styleGuido van Rossum2002-10-151-2/+2
| | | | | | | | | | | | | | classes was called with three arguments. This makes no sense, there's no way to pass in the "modulo" 3rd argument as for __pow__, and classic classes don't do this. [SF bug 620179] I don't want to backport this to 2.2.2, because it could break existing code that has developed a work-around. Code in 2.2.2 that wants to use __ipow__ and wants to be forward compatible with 2.3 should be written like this: def __ipow__(self, exponent, modulo=None): ...
* Don't drop old slots if _unicode_to_string did not change anything.Martin v. Löwis2002-10-141-2/+4
|
* Allow Unicode strings in __slots__, converting them to byte strings.Martin v. Löwis2002-10-141-0/+39
|
* Darn! Don't divide by zero. Bad fix. :-)Guido van Rossum2002-10-111-1/+1
|
* Add checks for size overflow on list*n, list+list, tuple+tuple.Guido van Rossum2002-10-112-0/+6
| | | | Will backport.
* PyObject_Init[Var] is almost always called from the PyObject_NEW[_VAR]Guido van Rossum2002-10-111-10/+4
| | | | | | | | | | macros. The 'op' argument is then the result from PyObject_MALLOC, and that can of course be NULL. In that case, PyObject_Init[Var] would raise a SystemError with "NULL object passed to PyObject_Init[Var]". But there's nothing the caller of the macro can do about this. So PyObject_Init[Var] should call just PyErr_NoMemory. Will backport.
* Back out #479898.Martin v. Löwis2002-10-111-69/+15
|
* Fix a nasty endcase reported by Armin Rigo in SF bug 618623:Guido van Rossum2002-10-112-4/+12
| | | | | | | | | | | | | '%2147483647d' % -123 segfaults. This was because an integer overflow in a comparison caused the string resize to be skipped. After fixing the overflow, this could call _PyString_Resize() with a negative size, so I (1) test for that and raise MemoryError instead; (2) also added a test for negative newsize to _PyString_Resize(), raising SystemError as for all bad arguments. An identical bug existed in unicodeobject.c, of course. Will backport to 2.2.2.
* Undo this part of the previous checkin:Guido van Rossum2002-10-091-3/+4
| | | | | | | | | Also fixed an error message -- %s argument has non-string str() doesn't make sense for %r, so the error message now differentiates between %s and %r. because PyObject_Repr() and PyObject_Str() ensure that this can never happen. Added a helpful comment instead.
* The string formatting code has a test to switch to Unicode when %sGuido van Rossum2002-10-091-2/+5
| | | | | | | | | | | | | | sees a Unicode argument. Unfortunately this test was also executed for %r, because %s and %r share almost all of their code. This meant that, if u is a unicode object while repr(u) is an 8-bit string containing ASCII characters, '%r' % u is a *unicode* string containing only ASCII characters! Fixed by executing the test only for %s. Also fixed an error message -- %s argument has non-string str() doesn't make sense for %r, so the error message now differentiates between %s and %r.
* Include wctype.h.Martin v. Löwis2002-10-071-1/+2
|
* Patch #479898: Use multibyte C library for printing strings if available.Martin v. Löwis2002-10-071-15/+68
|
* Patch 594001: PEP 277 - Unicode file name support for Windows NT.Mark Hammond2002-10-031-13/+83
|
* Add cast to avoid compiler warning.Marc-André Lemburg2002-09-241-1/+1
|
* Fix part of SF bug # 544248 gcc warning in unicodeobject.cNeal Norwitz2002-09-131-1/+1
| | | | When --enable-unicode=ucs4, need to cast Py_UNICODE to a char
* Fix warnings on 64-bit platforms about casts from pointers to ints.Guido van Rossum2002-09-123-3/+5
| | | | Two of these were real bugs.
* Fix for platforms where int != long.Michael W. Hudson2002-09-121-1/+1
|
* Insert an overflow check when the sequence repetition count is outsideGuido van Rossum2002-09-111-3/+30
| | | | | | | the range of ints. The old code would pass random truncated bits to sq_repeat() on a 64-bit machine. Backport candidate.
* Untested code for 64-bit platforms. range_length() is declared as intGuido van Rossum2002-09-111-1/+8
| | | | | | | | | | but returns r->len which is a long. This doesn't even cause a warning on 32-bit platforms, but can return bogus values on 64-bit platforms (and should cause a compiler warning). Fix this by inserting a range check when LONG_MAX != INT_MAX, and adding an explicit cast to (int) when the test passes. When r->len is out of range, PySequence_Size() and hence len() will report an error (but an iterator will still work).
* A slight change to SET_LINENO-less tracing.Michael W. Hudson2002-09-111-2/+36
| | | | | This makes things a touch more like 2.2. Read the comments in Python/ceval.c for more details.
* Fix escaping of non-ASCII characters.Martin v. Löwis2002-09-091-2/+4
|
* PyObject_RichCompareBool() already returns -1, 0, or 1, so return its valueNeal Norwitz2002-09-052-10/+2
|
* Micro-optimization for list_contains. Factored double if testRaymond Hettinger2002-09-051-7/+6
| | | | out of the loop.
* Micro-optimization for list_contains. Factored double if testRaymond Hettinger2002-09-051-8/+7
| | | | out of the loop.
* Change the unicode.translate docstring to document thatWalter Dörwald2002-09-041-2/+3
| | | | | | | | | | Unicode strings (with arbitrary length) are allowed as entries in the unicode.translate mapping. Add a test case for multicharacter replacements. (Multicharacter replacements were enabled by the PEP 293 patch)
* In doc strings, use 'k in D' rather than D.has_key(k).Guido van Rossum2002-09-041-2/+2
|
* replace thread state objects' ticker and checkinterval fields with twoSkip Montanaro2002-09-031-4/+2
| | | | | | | | | | globals, _Py_Ticker and _Py_CheckInterval. This also implements Jeremy's shortcut in Py_AddPendingCall that zeroes out _Py_Ticker. This allows the test in the main loop to only test a single value. The gory details are at http://python.org/sf/602191
* Check whether a string resize is necessary at the endWalter Dörwald2002-09-031-3/+4
| | | | | | | | | of PyString_DecodeEscape(). This prevents a call to _PyString_Resize() for the empty string, which would result in a PyErr_BadInternalCall(), because the empty string has more than one reference. This closes SF bug http://www.python.org/sf/603937