summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer classGuido van Rossum2001-01-191-51/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for SocketServer.py (inherited by TCPServer) Luke wrote: The socketserver code, with a little bit of tweaking, can be made sufficiently general to service "requests" of any kind, not just by sockets. The BaseServer class was created, for example, to poll a table in a MYSQL database every 2 seconds. each entry in the table can be allocated a Handler which deals with the entry. With this patch, using BaseServer and ThreadedServer classes, the creation of the server that reads and handles MySQL table entries instead of a socket was utterly trivial: about 50 lines of python code. You may consider this code to be utterly useless [why would anyone else want to do anything like this???] - you are entitled to your opinion. if you think so, then think of this: have you considered how to cleanly add SSL to the TCPSocketServer? What about using shared memory as the communications mechanism for a server, instead of sockets? What about communication using files? The SocketServer code is extremely good every useful. it's just that as it stands, it is tied to sockets, which is not as useful. I heartily approve of this idea.
* SF Patch #103188, by Donn Cave: BeOS/ar-fake support for extraGuido van Rossum2001-01-191-2/+11
| | | | | | libraries. (I have no way to test this, I just trust Donn.)
* SF Patch #103185, by jlt63: Some more standard modules cleanup for CygwinGuido van Rossum2001-01-191-1/+2
| | | | Support building this as a DLL under Cygwin.
* Support building this as a DLL under Cygwin.Guido van Rossum2001-01-191-2/+5
|
* SF Patch #103250, by pj99: Optimize a strspn() out of startup.Guido van Rossum2001-01-191-4/+21
| | | | Minor startup speedup: avoid a call to strspn().
* Add test that ensures hash() of objects defining __cmp__ or __eq__ butGuido van Rossum2001-01-181-0/+23
| | | | not __hash__ raises TypeError.
* Rich comparisons fallout: instance_hash() should check for bothGuido van Rossum2001-01-181-7/+14
| | | | | __cmp__ and __eq__ absent before deciding to do a quickie based on the object address. (Tim Peters discovered this.)
* Add test that ensures hash([]) and hash({}) raise TypeError.Guido van Rossum2001-01-181-0/+6
|
* Rich comparisons fallout: PyObject_Hash() should check for bothGuido van Rossum2001-01-181-1/+1
| | | | | tp_compare and tp_richcompare NULL before deciding to do a quickie based on the object address. (Tim Peters discovered this.)
* Changes to recursive-object comparisons, having to do with a test caseGuido van Rossum2001-01-181-107/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found where rich comparison of unequal recursive objects gave unintuituve results. In a discussion with Tim, where we discovered that our intuition on when a<=b should be true was failing, we decided to outlaw ordering comparisons on recursive objects. (Once we have fixed our intuition and designed a matching algorithm that's practical and reasonable to implement, we can allow such orderings again.) - Refactored the recursive-object comparison framework; more is now done in the support routines so less needs to be done in the calling routines (even at the expense of slowing it down a bit -- this should normally never be invoked, it's mostly just there to avoid blowing up the interpreter). - Changed the framework so that the comparison operator used is also stored. (The dictionary now stores triples (v, w, op) instead of pairs (v, w).) - Changed the nesting limit to a more reasonable small 20; this only slows down comparisons of very deeply nested objects (unlikely to occur in practice), while speeding up comparisons of recursive objects (previously, this would first waste time and space on 500 nested comparisons before it would start detecting recursion). - Changed rich comparisons for recursive objects to raise a ValueError exception when recursion is detected for ordering oprators (<, <=, >, >=). Unrelated change: - Moved PyObject_Unicode() to just under PyObject_Str(), where it belongs. MAL's patch must've inserted in a random spot between two functions in the file -- between two helpers for rich comparison...
* Since I'm about to check in a change to the recursion-detection codeGuido van Rossum2001-01-181-17/+10
| | | | | for comparisons that outlaws requets for ordering on recursive data structures, remove the tests for ordering recursive data structures.
* Patch #103313: Fixes "make test" by adding a little file namedAndrew M. Kuchling2001-01-181-4/+7
| | | | | "platform", running the Python binary to create it, and then using it to set PYTHONPATH.
* Patch from Barry: gets rid of two unused imports,Andrew M. Kuchling2001-01-181-14/+28
| | | | | | | wraps to 80chars, and adds some really hacky setting of compiler options when CC and LDSHARED are given on the make command line. (The Distutils should probably provide a utility function to automatically handle a number of common environment variables)
* Clarifications.Tim Peters2001-01-181-7/+7
|
* Sizable reorganization of how header and library files are foundAndrew M. Kuchling2001-01-181-105/+166
| | | | | | | | Check additional include directories for SSL Don't build modules that are linked into the Python binary statically Factored out the detection of Tkinter out into a method, since it's the most complicated module to set up Simplify the logic for detecting Tkinter
* Minor markup cleaning, and one required fix in the unistr() description.Fred Drake2001-01-181-7/+7
|
* Use openssl/*.h to include the OpenSSL header filesAndrew M. Kuchling2001-01-181-6/+6
|
* A dumb test for the dumdbm module.Guido van Rossum2001-01-182-0/+40
|
* Add test for comparing recursive data types.Guido van Rossum2001-01-181-1/+42
|
* Make the original, makesetup-based, targets for building shared modulesAndrew M. Kuchling2001-01-181-14/+16
| | | | | | available as "oldsharedmods" and "oldsharedinstall". You'll need to get a copy of the full Setup.dist out of the CVS for them to actually do much.
* Bite the bullet: use rich comparisons here, too.Guido van Rossum2001-01-181-4/+10
|
* Add test for misbehaving rich comparisons (always returning 0) --Guido van Rossum2001-01-181-1/+23
| | | | these fall back to __cmp__.
* Rich comparison testsGuido van Rossum2001-01-182-0/+364
|
* Document rich comparisons.Guido van Rossum2001-01-181-5/+42
|
* Updated for 2.1; removed references to BeOpen.com and PythonLabs.Guido van Rossum2001-01-181-35/+28
| | | | Added Copyright GvR.
* Add my name to the copyright notice.Guido van Rossum2001-01-181-1/+5
|
* 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.