summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add note about copyright ownership and license situation.Guido van Rossum2001-01-181-0/+10
|
* - Add note about complex numbers.Guido van Rossum2001-01-181-9/+16
| | | | | | - Changed description of rich comparisons to emphasize that < and > (etc.) are each other's reflection. Also use this word in the note about the demise of __rcmp__.
* correct typo - closes bug #129205Skip Montanaro2001-01-181-1/+1
|
* Fix the example (it didn't seem to reflect reality).Ka-Ping Yee2001-01-181-12/+14
|
* Remove build/ subdirectory in "clean" target, not "clobber"Andrew M. Kuchling2001-01-181-1/+1
|
* Variant of SF patch 103252: Startup optimize: read *.pyc as string, not with ↵Tim Peters2001-01-182-0/+48
| | | | getc().
* Move distributed and duplicated config for stat() and fstat() into pyport.h.Tim Peters2001-01-184-51/+34
|
* Whitespace normalization. Leaving tokenize_tests.py alone for now.Tim Peters2001-01-189-45/+42
|
* Use rich comparisons to fulfill an old wish: complex numbers now raiseGuido van Rossum2001-01-181-49/+84
| | | | | | | | | | | exceptions when compared using <, <=, > or >=. NOTE: This is a tentative change: this means that cmp() involving complex numbers will raise an exception when the numbers differ, and that in turn means that e.g. dictionaries and certain other compounds (e.g. UserLists) containing complex numbers can't be compared either. So we'll have to decide whether this is acceptable. The alpha test cycle is a good time to keep an eye on this!
* Same treatment as listobject.c:Guido van Rossum2001-01-181-67/+156
| | | | | | | | | | | | - In count(), remove(), index(): call RichCompare(Py_EQ). - Get rid of array_compare(), in favor of new array_richcompare() (a near clone of list_compare()). - Aligned items in array_methods initializer and comments for type struct initializer. - Folded a few long lines.
* Rich comparisons:Guido van Rossum2001-01-181-118/+45
| | | | | | | | | | | | | | | | | | | | | - Use PyObject_RichCompareBool() when comparing keys; this makes the error handling cleaner. - There were two implementations for dictionary comparison, an old one (#ifdef'ed out) and a new one. Got rid of the old one, which was abandoned years ago. - In the characterize() function, part of dictionary comparison, use PyObject_RichCompareBool() to compare keys and values instead. But continue to use PyObject_Compare() for comparing the final (deciding) elements. - Align the comments in the type struct initializer. Note: I don't implement rich comparison for dictionaries -- there doesn't seem to be much to be gained. (The existing comparison already decides that shorter dicts are always smaller than longer dicts.)
* Same treatment as listobject.c:Guido van Rossum2001-01-181-43/+104
| | | | | | | | | - tuplecontains(): call RichCompare(Py_EQ). - Get rid of tuplecompare(), in favor of new tuplerichcompare() (a clone of list_compare()). - Aligned the comments for large struct initializers.
* Fix a leak in instance_coerce(). This was introduced by Neil'sGuido van Rossum2001-01-171-2/+0
| | | | | | | | | earlier coercion changes, not by rich comparisons. When a coercion function returns 1 (meaning it cannot do it), it should not INCREF the arguments. When no __coerce__() method was found, instance_coerce() originally returned 0, pretending it did it. Neil changed the return value to 1, more accurately reflecting that it didn't do anything, but forgot to take out the two INCREF calls.
* Windows: 2.1a1 changes so Python runs again. Note that the python20Tim Peters2001-01-179-1757/+1757
| | | | subproject is gone, replaced by the new pythoncore subproject.
* The signal module has to be compiled statically, so add it to Setup.distAndrew M. Kuchling2001-01-172-9/+3
| | | | and remove support for it from setup.py
* Convert to rich comparisons:Guido van Rossum2001-01-171-90/+163
| | | | | | | | | | | | | | | | - sort's docompare() calls RichCompare(Py_LT). - list_contains(), list_index(), listcount(), listremove() call RichCompare(Py_EQ). - Get rid of list_compare(), in favor of new list_richcompare(). The latter does some nice shortcuts, like when == or != is requested, it first compares the lengths for trivial accept/reject. Then it goes over the items until it finds an index where the items differe; then it does more shortcut magic to minimize the number of additional comparisons. - Aligned the comments for large struct initializers.
* Bump up version number.Neil Schemenauer2001-01-172-4/+4
|
* - compile struct moduleNeil Schemenauer2001-01-171-2/+2
| | | | - get version number from sys.version_info
* a bold attempt to fix things broken by MAL's verify patch: importFredrik Lundh2001-01-1748-51/+54
| | | | 'verify' iff it's used by a test module...
* Marc-Andre must not have run these tests -- they used verify() butGuido van Rossum2001-01-173-3/+5
| | | | | didn't import it. Also got rid of some inconsistent spaces inside parentheses in test_gzip.py.
* Get rid of the declaration for _PyCompareState_Key.Guido van Rossum2001-01-171-3/+0
|
* Get rid of the initialization of _PyCompareState_Key.Guido van Rossum2001-01-171-2/+0
|
* Deal properly (?) with comparing recursive datastructures.Guido van Rossum2001-01-171-62/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use the compare nesting level and in-progress dictionary properly in PyObject_RichCompare(). - Change the in-progress code to use static variables instead of globals (both the nesting level and the key for the thread dict were globals but have no reason to be globals; the key can even be a function-static variable in get_inprogress_dict()). - Rewrote try_rich_to_3way_compare() to benefit from the similarity of the three cases, making it table-driven. - In try_rich_to_3way_compare(), test for EQ before LT and GT. This turns out essential when comparing recursive UserList instances; with the old code, these would recurse into rich comparison three times for each nesting level up to NESTING_LIMIT/2, making the total number of calls in the order of 3**(NESTING_LIMIT/2)! NOTE: I'm not 100% comfortable with this. It works for the standard test suite (which compares a few trivial recursive data structures only), but I'm not sure that the in-progress dictionary is used properly by the rich comparison code. Jeremy suggested that maybe the operation should be included in the dict. Currently I presume that objects in the dict are equal unless proven otherwise, and I set the outcome for the rich comparison accordingly: true for operators EQ, LE, GE, and false for the other three. But Jeremy seems to think that there may be counter-examples where this doesn't do the right thing.
* Fix for bug #129173, reported by Skip Montanaro:Andrew M. Kuchling2001-01-171-4/+11
| | | | | Check for the two possible headers for Expat, expat.h and xmlparse.h, and only compile the pyexpat module if one of them is found.
* strop doesn't actually seem to be neededAndrew M. Kuchling2001-01-171-1/+0
|
* Use the extended library search path when looking for readline (simpleAndrew M. Kuchling2001-01-171-1/+1
| | | | oversight in using self.compiler.library_dirs)
* Restore lost AFMT_S16_NE entry.Ka-Ping Yee2001-01-171-0/+1
|
* This patch removes all uses of "assert" in the regression test suiteMarc-André Lemburg2001-01-1770-412/+436
| | | | | | | and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* Stop creating an unbounded number of "Jack is my hero" files under Windows.Tim Peters2001-01-171-0/+1
| | | | | Not that Jack doesn't deserve them, but saying it so often cheapens the sentiment.
* Patch #102588 / PEP 229:Andrew M. Kuchling2001-01-172-392/+7
| | | | | | | The final piece of this change... Strip down Setup.config.in and Setup.dist to the minimal sets required to get a working Python; setup.py will handle the rest
* Patch #102588 / PEP 229:Andrew M. Kuchling2001-01-171-15/+20
| | | | | | The final piece of this change... Run setup.py to build shared modules and to install them.
* Undoing the whitespace patches which sneaked into the earlier patch.Marc-André Lemburg2001-01-171-6/+6
|
* This patch adds a new builtin unistr() which behaves like str()Marc-André Lemburg2001-01-1710-6/+119
| | | | | | | | | | except that it always returns Unicode objects. A new C API PyObject_Unicode() is also provided. This closes patch #101664. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* Various clean-ups:Andrew M. Kuchling2001-01-171-15/+7
| | | | | | * Uncomment the xreadlines module * The Tcl/Tk detection code doesn't need to worry about pre-8.0 versions * Fix some debugging changes (not running ar, a commented-out line)
* News item for rich comparisons.Guido van Rossum2001-01-171-0/+43
| | | | | (I'm going to check in some more uses of rich comparisons, but the basic feature should be in place now.)
* Use rich comparisons in min and max.Guido van Rossum2001-01-171-9/+9
|
* Rich comparisons fall-out:Guido van Rossum2001-01-171-148/+147
| | | | | | | | | | | | - Use PyObject_RichCompare*() where possible: when comparing keyword arguments, in _PyEval_SliceIndex(), and of course in cmp_outcome(). Unrelated stuff: - Removed all trailing whitespace. - Folded some long lines.
* Rich comparisons fall-out:Guido van Rossum2001-01-171-14/+1
| | | | | | - Get rid of float_cmp(). - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.
* Rich comparisons fall-out:Guido van Rossum2001-01-171-17/+1
| | | | | | - Get rid of long_cmp(). - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.
* Rich comparisons fall-out:Guido van Rossum2001-01-171-14/+1
| | | | | | - Get rid of int_cmp(). - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.
* Rich comparisons fall-out:Guido van Rossum2001-01-171-4/+4
| | | | | | - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES. - Use PyObject_RichCompareBool() in PySequence_Contains().
* Rich comparisons.Guido van Rossum2001-01-171-146/+278
| | | | | | | | | | | | | | | | - Got rid of instance_cmp(); refactored instance_compare(). - Added instance_richcompare() which calls __lt__() etc. Some unrelated stuff mixed in: - Aligned comments in various large struct initializers. - Better test to avoid recursion if __coerce__ returns self as the first argument (this is an unrelated fix by Neil Schemenauer!). - Style nit: don't use Py_DECREF(Py_NotImplemented); use Py_DECREF(result) -- it just looks better. :-)
* Patch #102588 / PEP 229:Andrew M. Kuchling2001-01-172-4/+4
| | | | Tweak the configure script to build setup.cfg
* Rich comparisons. Refactored internal routine do_cmp() and added APIsGuido van Rossum2001-01-171-74/+293
| | | | | | | | PyObject_RichCompare() and PyObject_RichCompareBool(). XXX Note: the code that checks for deeply nested rich comparisons is bogus -- it assumes the two objects are always identical, rather than using the same logic as PyObject_Compare(). I'll fix that later.
* [Patch #102588/PEP 229]:Andrew M. Kuchling2001-01-172-0/+478
| | | | | Check in the setup.py script, and the setup.cfg.in file, which handle compiling and installing as many extension modules as possible
* Rich comparisons: ensure that LT == Py_LT, etc.Guido van Rossum2001-01-171-1/+2
|
* Introduction to rich comparisons:Guido van Rossum2001-01-171-12/+22
| | | | | | | | | | | | | | - Removed the nb_add slot from the PyNumberMethods struct. - Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES. - Added typedef richcmpfunc. - Added tp_richcompare slot to PyTypeObject (replacing spare tp_xxx7). - Added APIs PyObject_RichCompare() and PyObject_RichCompareBool(). - Added rich comparison operators Py_LT through Py_GE.
* Patch #103279: sysconfig.py always looks for versions of files inAndrew M. Kuchling2001-01-171-1/+19
| | | | | | | | sys.prefix + 'config/Makefile'. When building Python for the first time, these files aren't there, so the files from the build tree have to be used instead; this file adds an entry point for specifying that the build tree files should be used. (Perhaps 'set_python_build' should should be preceded with an underscore?)
* Fix a bizarre typo in the helper class ComparableException: theGuido van Rossum2001-01-171-1/+1
| | | | | | | | | | | | | __getattr__() method, which clearly (like the other methods) was intended to pass the __getattr__() call on to the self.err object, mistakenly returned getattr(self, self.err) rather than getattr(self.err, attr). Since self.err is not a string, this always raises a TypeError. Apparently that doesn't bother for the one attribute for which __getattr__() is actually called ('__coerce__'), but it broke the rich comparisons stuff that I'm trying to get into shape, so I'm fixing this now. (I could also simply remove the __getattr__() method, but fixing it seems more in the spirit of what the ComparableException class is trying to do.)
* Changed name of codec to full path name. This allows importingMarc-André Lemburg2001-01-171-1/+1
| | | | the test_charmapcodec test via the test package.