summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Expanded the unittests for the new width sensitive PyUnicode_Contains().Raymond Hettinger2002-08-061-0/+6
|
* Add testcase for SF bug 574207 (chained __slots__ dealloc segfault).Guido van Rossum2002-08-061-0/+14
| | | | Fix forthcoming.
* Added a test for PyUnicode_Contains() taking into account the width ofBarry Warsaw2002-08-061-0/+1
| | | | Py_UNICODE.
* Add a coding cookie, because of the møøse quote.Guido van Rossum2002-08-061-0/+1
|
* Bump the LOOPS count. 50,000 iterations takes about 5 seconds on myGuido van Rossum2002-08-061-1/+1
| | | | machine -- that feels just right.
* Mark xreadlines deprecated. Don't use f.xreadlines() in test_iter.py.Guido van Rossum2002-08-062-2/+5
|
* Remove mention of deprecated xreadlines method.Guido van Rossum2002-08-061-1/+1
|
* Committing patch #591250 which provides "str1 in str2" when str1 is aBarry Warsaw2002-08-065-65/+88
| | | | string of longer than 1 character.
* Add next and __iter__ to the list of file methods that should raiseGuido van Rossum2002-08-061-1/+3
| | | | ValueError when called for a closed file.
* We only need to check for StopIteration here.Fred Drake2002-08-051-1/+1
|
* SF patch 590294: os._execvpe security fix (Zack Weinberg).Guido van Rossum2002-08-051-21/+6
| | | | | | | | | | | | | | 1) Do not attempt to exec a file which does not exist just to find out what error the operating system returns. This is an exploitable race on all platforms that support symbolic links. 2) Immediately re-raise the exception if we get an error other than errno.ENOENT or errno.ENOTDIR. This may need to be adapted for other platforms. (As a security issue, this should be considered for 2.1 and 2.2 as well as 2.3.)
* GvR provided solution to the socket rebinding timeout problem.Kurt B. Kaiser2002-08-053-7/+6
| | | | | | M PyShell.py M rpc.py M run.py
* Test whether a Cyrillic text correctly appears in a Unicode literal.Martin v. Löwis2002-08-051-0/+2
|
* We don't really need the name of the test in the "test skipped" msg, andTim Peters2002-08-041-1/+1
| | | | having it there causes the line to wrap.
* Oops! Forgot the closing paren.Tim Peters2002-08-041-1/+1
|
* Finally got around to figuring out and documenting why this test failsTim Peters2002-08-041-2/+10
| | | | | | | | on Windows. The test_sequence() ERROR is easily repaired if we're willing to add an os.unlink() line to mhlib's updateline(). The test_listfolders FAIL I gave up on -- I don't remember enough about Unix link esoterica to recall why a link count of 2 is something a well- written program should be keenly interested in <wink>.
* Add encoding declaration.Martin v. Löwis2002-08-042-1/+2
|
* Add encoding declaration.Martin v. Löwis2002-08-042-0/+2
|
* I don't know what's going on with this test, but the last change fromTim Peters2002-08-041-1/+1
| | | | | Piers obviously couldn't have passed on any platform. Fiddling it so it works (for a meaning of "works" no stronger than "doesn't fail" <wink>).
* - comment improvementAndrew MacIntyre2002-08-041-1/+25
| | | | - implement viable library search routine for EMX
* add parameter missing following Jeremy's compiler class refactoringAndrew MacIntyre2002-08-041-1/+1
|
* _siftup(): __le__ is now the only comparison operator used on arrayTim Peters2002-08-031-1/+1
| | | | elements.
* revert to version 1.2Piers Lauder2002-08-031-5/+6
|
* Added new heapreplace(heap, item) function, to pop (and return) theTim Peters2002-08-032-3/+20
| | | | | currently-smallest value, and add item, in one gulp. See the second N-Best algorithm in the test suite for a natural use.
* Large code rearrangement to use better algorithms, in the sense of needingTim Peters2002-08-031-39/+79
| | | | | | | | | | | | substantially fewer array-element compares. This is best practice as of Kntuh Volume 3 Ed 2, and the code is actually simpler this way (although the key idea may be counter-intuitive at first glance! breaking out of a loop early loses when it costs more to try to get out early than getting out early saves). Also added a comment block explaining the difference and giving some real counts; demonstrating that heapify() is more efficient than repeated heappush(); and emphasizing the obvious point thatlist.sort() is more efficient if what you really want to do is sort.
* Remove cut 'n paste silliness.Tim Peters2002-08-031-2/+0
|
* Minor fiddling, including a simple class to implement a heap iteratorTim Peters2002-08-032-10/+23
| | | | | in the test file. I have docs for heapq.heapify ready to check in, but Jack appears to have left behind a stale lock in the Doc/lib directory.
* Augment credits.Guido van Rossum2002-08-021-1/+1
|
* Hmm! I thought I checked this in before! Oh well.Tim Peters2002-08-022-10/+48
| | | | | | | | | | | | Added new heapify() function, which transforms an arbitrary list into a heap in linear time; that's a fundamental tool for using heaps in real life <wink>. Added heapyify() test. Added a "less naive" N-best algorithm to the test suite, and noted that this could actually go much faster (building on heapify()) if we had max-heaps instead of min-heaps (the iterative method is appropriate when all the data isn't known in advance, but when it is known in advance the tradeoffs get murkier).
* Add a PEP-263-style encoding turd^H^H^H^Hdeclaration, because there'sGuido van Rossum2002-08-021-0/+2
| | | | a c-cedilla in one of the docstrings.
* heappop(): Added comments; simplified and sped the code.Tim Peters2002-08-021-21/+19
|
* heappop(): Use "while True" instead of "while 1".Tim Peters2002-08-021-1/+1
|
* check_invariant(): Use the same child->parent "formula" used by heapq.py.Tim Peters2002-08-021-2/+2
|
* Don't use true division where int division was intended. For that matter,Tim Peters2002-08-022-2/+2
| | | | don't use division at all.
* Adding the heap queue algorithm, per discussion in python-dev lastGuido van Rossum2002-08-021-0/+48
| | | | week.
* catch the situation where Berkeley DB is used to emulate dbm(3) librarySkip Montanaro2002-08-021-3/+24
| | | | | functions. In this case, calling dbm.open("foo", "c") actually creates a file named "foo.db".
* regression test for the whichdb moduleSkip Montanaro2002-08-021-0/+63
|
* Add Kevin O'Connor, author of the heapq code.Guido van Rossum2002-08-021-0/+2
|
* Adding the heap queue algorithm, per discussion in python-dev lastGuido van Rossum2002-08-021-0/+176
| | | | week.
* testGetServByName shouldn't check for getservbyname - the socket moduleSkip Montanaro2002-08-021-18/+17
| | | | should always have it.
* New test %sort. This takes a sorted list, picks 1% of the list positionsTim Peters2002-08-021-1/+7
| | | | | | | | | | | | | | | | at random, and replaces the elements at those positions with new random values. I was pleasantly surprised by how fast this goes! It's hard to conceive of an algorithm that could special-case for this effectively. Plus it's exactly what happens if a burst of gamma rays corrupts your sorted database on disk <wink>. i 2**i *sort ... %sort 15 32768 0.18 ... 0.03 16 65536 0.24 ... 0.04 17 131072 0.53 ... 0.08 18 262144 1.17 ... 0.16 19 524288 2.56 ... 0.35 20 1048576 5.54 ... 0.77
* modify testGetServByName so it tries a few different protocols. In this daySkip Montanaro2002-08-021-5/+17
| | | | | | and age of rampant computer breakins I imagine there are plenty of systems with telnet disabled. Successful check of at least one getservbyname() call is required for success
* Fix for SF bug 570678 (can't flush read-only file on Mac OS X).Guido van Rossum2002-08-011-1/+0
|
* SF patch 588728 (Nathan Srebro).Guido van Rossum2002-08-011-4/+11
| | | | | | | | The __delete__ method wrapper for descriptors was not supported (I added a test, too.) 2.2 bugfix candidate.
* New test for sorting sanity. Note that this will fail in earlier Pythons,Tim Peters2002-08-011-0/+124
| | | | | | | | | | | | | | | | | | | | in the stability tests. Bizarre: this takes 11x longer to run if and only if test_longexp is run before it, on my box. The bigger REPS is in test_longexp, the slower this gets. What happens on your box? It's not gc on my box (which is good, because gc isn't a plausible candidate here). The slowdown is massive in the parts of test_sort that implicitly invoke a new-style class's __lt__ or __cmp__ methods. If I boost REPS large enough in test_longexp, even the test_sort tests on an array of size 64 visibly c-r-a-w-l. The relative slowdown is even worse in a debug build. And if I reduce REPS in test_longexp, the slowdown in test_sort goes away. test_longexp does do horrid things to Win98's management of user address space, but I thought I had made that a whole lot better a month or so ago (by overallocating aggressively in the parser).
* Restore a full arglist to the socket wrapper, so it supports keywordTim Peters2002-07-311-2/+2
| | | | arguments correctly too.
* For platforms (like Windows) that wrap _socket.socket:Tim Peters2002-07-311-2/+3
| | | | | | + Don't change the arglist requirements. + Give the wrapper the same docstring as _socket.socket (it didn't have any docstring).
* Reverting this to rev 1.3. It's apparently broken everywhere at revTim Peters2002-07-311-5/+5
| | | | 1.6, and pierslauder didn't respond to email about it on Monday.
* Enable test_socket again, if only to prevent mistakes like JeremyGuido van Rossum2002-07-311-2/+2
| | | | | thinking that he was running his new test by running "make test". Also, I can't get this to fail any more. Your turn. :-)
* Repair testNtoH for large long arguments.Jeremy Hylton2002-07-311-9/+8
| | | | | | If the long is large enough, the return value will be a negative int. In this case, calling the function a second time won't return the original value passed in.