summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Patch for bug #659709: bogus computation of float lengthMarc-André Lemburg2002-12-292-16/+37
| | | | | Python 2.2.x backport candidate. (This bug has been around since Python 1.6.)
* SF patch #659536: Use PyArg_UnpackTuple where possible.Raymond Hettinger2002-12-298-12/+12
| | | | | | | Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
* SF Bug 645777: list.extend() works with any iterable and is no longerRaymond Hettinger2002-12-291-1/+1
| | | | experimental.
* Fix bug introduced by SF patch #643835, Set Next Statement for Python debuggersNeal Norwitz2002-12-191-4/+12
| | | | | | blockstack_top could be 0 when blockstack[blockstack_top-1] was referenced (ie blockstack[-1]) which crashed on hpux. Patch & fix by Richie Hindle
* Undefine MIN and MAX before definingNeal Norwitz2002-12-181-0/+2
| | | | Some systems (HPUX at least) already define MIN/MAX for us
* SF # 654974, fix unchecked return values in structseqNeal Norwitz2002-12-181-2/+6
| | | | | | | Check return values after memory allocation. Also use Py_True instead of PyInt_FromLong(1) for bool value. Backport candidate.
* * Objects/fileobject.cGustavo Niemeyer2002-12-171-1/+1
| | | | | (file_read): Replaced assertion with mixed sign operation by a simple comment (thank you Raymond). The algorithm is clear enough in that point.
* This is Richie Hindle's patchMichael W. Hudson2002-12-171-1/+259
| | | | | | | | [ 643835 ] Set Next Statement for Python debuggers with a few tweaks by me: adding an unsigned or two, mentioning that not all jumps are allowed in the doc for pdb, adding a NEWS item and a note to whatsnew, and AuCTeX doing something cosmetic to libpdb.tex.
* Fixed bugGustavo Niemeyer2002-12-161-3/+30
| | | | | | | | | | | | | | | | | [#521782] unreliable file.read() error handling * Objects/fileobject.c (file_read): Clear errors before leaving the loop in all situations, and also check if some data was read before exiting the loop with an EWOULDBLOCK exception. * Doc/lib/libstdtypes.tex * Objects/fileobject.c Document that sometimes a read() operation can return less data than what the user asked, if running in non-blocking mode. * Misc/NEWS Document the fix.
* Punctuation fix.Raymond Hettinger2002-12-141-2/+2
|
* Tighten the tests for assignment to __bases__: disallow empty tuple.Guido van Rossum2002-12-131-0/+6
|
* Patch #650653: Raise always value error if the table is not 256 bytes long.Martin v. Löwis2002-12-121-6/+6
|
* Change issubclass() so that recursive tuples (directly or indirectlyWalter Dörwald2002-12-122-5/+6
| | | | | | containing class objects) are allowed as the second argument. This makes issubclass() more similar to isinstance() where recursive tuples are allowed too.
* Enhance issubclass() and PyObject_IsSubclass() so that a tuple isWalter Dörwald2002-12-122-28/+49
| | | | | | | | | | | supported as the second argument. This has the same meaning as for isinstance(), i.e. issubclass(X, (A, B)) is equivalent to issubclass(X, A) or issubclass(X, B). Compared to isinstance(), this patch does not search the tuple recursively for classes, i.e. any entry in the tuple that is not a class, will result in a TypeError. This closes SF patch #649608.
* Constify char* API. Fixes #651363. 2.2 candidate.Martin v. Löwis2002-12-111-3/+3
|
* Patch #650834: Document 'U' in file mode, remove stale variables.Martin v. Löwis2002-12-111-5/+1
|
* Update comments about the performance of xrange().Raymond Hettinger2002-12-111-2/+2
|
* SF 548651: Fix the METH_CLASS implementation.Tim Peters2002-12-093-4/+75
| | | | | | | Most of these patches are from Thomas Heller, with long lines folded by Tim. The change to test_descr.py is from Guido. See the bug report. Not a bugfix candidate -- METH_CLASS is new in 2.3.
* slot_nb_nonzero(): Another leak uncovered by the sandbox datetimeTim Peters2002-12-071-28/+27
| | | | | | | tests. I found the logic too confusing to follow here, so rewrote more than was likely absolutely necessary. Bugfix candidate.
* Fix typo in abstract.c which caused __rpow__ to not be invoked.Raymond Hettinger2002-12-071-1/+1
| | | | | Added related testcase. Closes SF bug #643260.
* Remove assumption that cls is a subclass of dict.Raymond Hettinger2002-12-071-7/+1
| | | | Simplifies the code and gets Just van Rossum's example to work.
* slot_tp_hash(): In the normal path, this leaked a reference to theTim Peters2002-12-061-3/+3
| | | | | | integer hash object returned by __hash__(). This accounts for some of the "mystery leaks" in the sandbox datetime tests, but probably not all of them.
* Patch #614055: Support OpenVMS.Martin v. Löwis2002-12-061-1/+5
|
* The final tweaks before closingMichael W. Hudson2002-12-051-20/+23
| | | | | | [ 633152 ] list slice ass ignores subtypes of list Allow arbitrary sequences on the RHS of extended slices.
* Replace BadInternalCall with TypeError. Add a test case. Fix whitespace.Raymond Hettinger2002-12-041-2/+3
| | | | | | | Just van Rossum showed a weird, but clever way for pure python code to trigger the BadInternalCall. The C code had assumed that calling a class constructor would return an instance of that class; however, classes that abuse __new__ can invalidate that assumption.
* Add missing decrefNeal Norwitz2002-11-271-0/+1
|
* Nudge getting __module__ and __name__ for new-style classes so thatMichael W. Hudson2002-11-271-17/+24
| | | | | | | the results of *setting* __name__ are not so surprising. If people can suggest more tests, that'd be grand, or is what's there sufficient?
* I don't know why staring at the email to python-checkins made meMichael W. Hudson2002-11-271-9/+14
| | | | | | | see problems with my code that I didn't see before the checkin, but: When a subtype .mro() fails, we need to reset the type whose __bases__ are being changed, too. Fix + test.
* Readjustments to the way we cope with exceptions from subclasses'Michael W. Hudson2002-11-271-10/+32
| | | | | | mro() methods. Now any exception aborts the whole __bases__ change. And more tests.
* I had the inheritance cycle stuff backwards. Oops!Michael W. Hudson2002-11-271-4/+6
|
* SF Patch 643443. Added dict.fromkeys(iterable, value=None), a classRaymond Hettinger2002-11-271-0/+56
| | | | method for constructing new dictionaries from sequences of keys.
* Initialize a variable. Hope this makes things work for Guido.Michael W. Hudson2002-11-261-1/+1
| | | | It's odd that gcc on my ibook didn't complain about this.
* This is my patch:Michael W. Hudson2002-11-261-34/+277
| | | | | | | | | | | | [ 635933 ] make some type attrs writable Plus a couple of extra tests beyond what's up there. It hasn't been as carefully reviewed as it perhaps should, so all readers are encouraged, nay exhorted, to give this a close reading. There are still a couple of oddities related to assigning to __name__, but I intend to solicit python-dev's opinions on these.
* A tweaked version of Jeremy's patch #642489, to produce better errorGuido van Rossum2002-11-251-4/+138
| | | | | | messages about MRO conflicts. (The tweaks include correcting spelling errors, some refactoring to get the name of classic classes, and a style nit or two.)
* Add unidata_version. Bump generator version number.Martin v. Löwis2002-11-251-1/+1
|
* Regenerate from Unicode 3.2.0 to include all First/Last ranges.Martin v. Löwis2002-11-241-108/+77
|
* Simplify use of NB_BINOP and NB_TERNOP by making them do the pointerNeil Schemenauer2002-11-241-15/+15
| | | | dereference rather than the caller.
* Remove special handling of str and unicode in PyNumber_InPlaceRemainder. TheyNeil Schemenauer2002-11-241-9/+2
| | | | both have a nb_remainer slot.
* Patch #642500 with slight modifications: allow keyword arguments inJust van Rossum2002-11-231-5/+7
| | | | | | | dict() constructor. Example: >>> dict(a=1, b=2) {'a': 1, 'b': 2} >>>
* Remove MALLOC_ZERO_RETURNS_NULL.Martin v. Löwis2002-11-231-2/+0
|
* Fix --disable-unicode compilation problems.Martin v. Löwis2002-11-211-0/+4
|
* float_int(): Some systems raise an exception if a double is cast toTim Peters2002-11-211-14/+16
| | | | | | | | long but the double is too big to fit in a long. Prevent that. This closes some recent bug or patch on SF, but SF is down now so I can't say which. Bugfix candidate.
* Change int() so that passing a string, unicode, float or long argumentWalter Dörwald2002-11-193-24/+45
| | | | | | | that is outside the integer range no longer raises OverflowError, but returns a long object instead. This fixes SF bug http://www.python.org/sf/635115
* Add nb_remainder (i.e. __mod__) slot to unicode type. Fixes SF bug #615506.Neil Schemenauer2002-11-181-2/+21
|
* Add nb_remainder (i.e. __mod__) slot to str type. Fixes SF bug #615506.Neil Schemenauer2002-11-181-2/+22
|
* Improve exception message raised by PyFloat_AsDouble if the object does notNeil Schemenauer2002-11-181-2/+6
| | | | have a nb_float slot. This matches what PyInt_AsLong does.
* str and unicode objects now have a __mod__ slot so don't special case them inNeil Schemenauer2002-11-181-6/+0
| | | | | PyNumber_Remainder(). This fixes SF bug #615506 and allows string and unicode subclasses to override __mod__.
* Remove _Py_ResetReferences. Fixes bug #529750 "Circular reference makesNeil Schemenauer2002-11-171-7/+0
| | | | | | Py_Init crash". refchain cannot be cleared because objects can live across Py_Finalize() and Py_Initialize() if they are kept alive by circular references.
* 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.