summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Hack to make this play nicer with *old* versions of Python: os.path.abspath()Fred Drake2001-05-291-0/+10
| | | | | was not available in Python 1.5.1. (Yes, a user actually tried to use this with that version of Python!)
* Bring the notes on the relationship between __cmp__(), __eq__(), andFred Drake2001-05-291-10/+15
| | | | | | | __hash__() up to date (re: use of objects which define these methods as dictionary keys). This closes SF bug #427698.
* Fix typo reported in SF bug #427783.Fred Drake2001-05-291-1/+1
|
* The parameter to the listen() method is not optional, but was marked asFred Drake2001-05-291-1/+1
| | | | | | optional in the documentation. This closes SF bug #427985.
* Removed information on the old third parameter to _PyTuple_Resize().Fred Drake2001-05-291-1/+20
| | | | | | Added information on PyIter_Check(), PyIter_Next(), PyObject_Unicode(), PyString_AsDecodedObject(), PyString_AsEncodedObject(), and PyThreadState_GetDict().
* If the input line does not contain enough fields, raise a meaningfulFred Drake2001-05-291-0/+2
| | | | error.
* Do not start API descriptions with "Does the same, but ..." -- actuallyFred Drake2001-05-291-10/+13
| | | | | | | | state *which* other function the current one is like, even if the descriptions are adjacent. Revise the _PyTuple_Resize() description to reflect the removal of the third parameter.
* _PyTuple_Resize: guard against PyTuple_New() returning NULL, using Tim'sThomas Wouters2001-05-291-1/+1
| | | | suggestion (modulo style).
* Whitespace normalization.Tim Peters2001-05-293-3/+2
|
* Patch from Gordon McMillan.Tim Peters2001-05-291-5/+12
| | | | | | updatecache(): When using imputil, sys.path may contain things other than strings. Ignore such things instead of blowing up. Hard to say whether this is a bugfix or a feature ...
* Cruft cleanup: Removed the unused last_is_sticky argument from the internalTim Peters2001-05-286-10/+15
| | | | _PyTuple_Resize().
* _PyTuple_Resize: take into account the empty tuple. There can be only one.Thomas Wouters2001-05-281-2/+11
| | | | | | | Instead of raising a SystemError, just create a new tuple of the desired size. This fixes (at least) SF bug #420343.
* Implement an old idea of Christian Tismer's: use polynomial divisionTim Peters2001-05-272-18/+80
| | | | | | | | | | | | | | | instead of multiplication to generate the probe sequence. The idea is recorded in Python-Dev for Dec 2000, but that version is prone to rare infinite loops. The value is in getting *all* the bits of the hash code to participate; and, e.g., this speeds up querying every key in a dict with keys [i << 16 for i in range(20000)] by a factor of 500. Should be equally valuable in any bad case where the high-order hash bits were getting ignored. Also wrote up some of the motivations behind Python's ever-more-subtle hash table strategy.
* When reading from stdin (with the dialog box) use any partial line onJack Jansen2001-05-261-1/+8
| | | | stdout as the prompt. This makes raw_input() and print "xxx", ; sys.stdin.readline() work a bit more palatable.
* Change list.extend() error msgs and NEWS to reflect that list.extend()Tim Peters2001-05-262-3/+4
| | | | | | | now takes any iterable argument, not only sequences. NEEDS DOC CHANGES -- but I don't think we settled on a concise way to say this stuff.
* Cruft cleanup: removed the #ifdef'ery in support of compiling to allowTim Peters2001-05-261-18/+4
| | | | multi-argument list.append(1, 2, 3) (as opposed to .append((1,2,3))).
* roundupsize() and friends: fiddle over-allocation strategy for listTim Peters2001-05-261-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | resizing. Accurate timings are impossible on my Win98SE box, but this is obviously faster even on this box for reasonable list.append() cases. I give credit for this not to the resizing strategy but to getting rid of integer multiplication and divsion (in favor of shifting) when computing the rounded-up size. For unreasonable list.append() cases, Win98SE now displays linear behavior for one-at-time appends up to a list with about 35 million elements. Then it dies with a MemoryError, due to fatally fragmented *address space* (there's plenty of VM available, but by this point Win9X has broken user space into many distinct heaps none of which has enough contiguous space left to resize the list, and for whatever reason Win9x isn't coalescing the dead heaps). Before the patch it got a MemoryError for the same reason, but once the list reached about 2 million elements. Haven't yet tried on Win2K but have high hopes extreme list.append() will be much better behaved now (NT & Win2K didn't fragment address space, but suffered obvious quadratic-time behavior before as lists got large). For other systems I'm relying on common sense: replacing integer * and / by << and >> can't plausibly hurt, the number of function calls hasn't changed, and the total operation count for reasonably small lists is about the same (while the operations are cheaper now).
* Add a version annotation for splitdrive(); old, but as long as I managedFred Drake2001-05-251-0/+1
| | | | to end up with the information, it is better recorded than lost.
* Add descriptions of {}.iteritems(), {}.iterkeys(), and {}.itervalues()Fred Drake2001-05-251-12/+23
| | | | | | in the table of mapping object operations. Re-numbered the list of notes to reflect the move of the "Added in version 2.2." note to the list of notes instead of being inserted into the last column of the table.
* write(): Aggressively sort all catalog entries, and fix the bug whereBarry Warsaw2001-05-241-35/+37
| | | | | there were multiple translatable strings on a single line of source code.
* Patch #424335: Implement string_richcompare, remove string_compare.Martin v. Löwis2001-05-243-16/+81
| | | | Use new _PyString_Eq in lookdict_string.
* dictresize(): Rebuild small tables if there are any dummies, not just ifTim Peters2001-05-241-7/+11
| | | | | they're entirely full. Not a question of correctness, but of temporarily misplaced common sense.
* Jack Jansen hit a bug in the new dict code, reported on python-dev.Tim Peters2001-05-232-9/+43
| | | | | | | | | | dictresize() was too aggressive about never ever resizing small dicts. If a small dict is entirely full, it needs to rebuild it despite that it won't actually resize it, in order to purge old dummy entries thus creating at least one virgin slot (lookdict assumes at least one such exists). Also took the opportunity to add some high-level comments to dictresize.
* One more macroman<->latin1 conversion victim.Jack Jansen2001-05-231-19/+19
|
* write(): Do two levels of sorting: first sort the individual locationBarry Warsaw2001-05-231-0/+10
| | | | | tuples by filename/lineno, then sort the catalog entries by their location tuples.
* When Tim untabified this file, his editor accidentally assumed 4-spaceGuido van Rossum2001-05-231-4/+4
| | | | | tabs. The title was centered using 8-byte tabs, however, and the result looked strange. Fixed this.
* Updated to reflect the current state of config.h.in.Jack Jansen2001-05-231-7/+10
|
* Remove test_doctest's expected-output file.Tim Peters2001-05-234-330/+101
| | | | | | Change test_doctest and test_difflib to pass regrtest's notion of verbosity on to doctest. Add explanation for a dozen "new" things to test/README.
* Update to reflect recent changes to regrtest and the new approaches toFred Drake2001-05-231-7/+55
| | | | testing using doctest and PyUnit.
* Merge my changes to the offending comment with Guido's changes.Fred Drake2001-05-231-6/+10
|
* Remove test_difflib's output file and change test_difflib to stopTim Peters2001-05-232-281/+1
| | | | | generating it. Since this is purely a doctest, the output file never served a good purpose.
* Removed incorrect comment left over from sgmllib.py.Guido van Rossum2001-05-221-7/+7
|
* removed a routine that has moved to macglue.cJack Jansen2001-05-221-21/+0
|
* Remove unused variable.Fred Drake2001-05-221-1/+0
|
* Include Carbon/Carbon.h if appropriate.Jack Jansen2001-05-221-5/+5
| | | | Fixed glue initialization code so prototype is correct.
* Remove output files that are no longer needed since the correspondingFred Drake2001-05-222-11/+0
| | | | tests were moved to PyUnit.
* Added WITHOUT_FRAMEWORKS and USE_TOOLBOX_OBJECT_GLUE defines.Jack Jansen2001-05-224-1/+5
|
* Simple script to regenerate all bgen-generated modules.Jack Jansen2001-05-221-0/+38
|
* One more update related to the new get() and setdefault() methods on theFred Drake2001-05-221-5/+6
| | | | Message object.
* Lots more Carbon/Carbon.h includes, new UPP routine names, function ↵Jack Jansen2001-05-2241-5765/+2230
| | | | prototypes. Most toolbox modules now compile, link and import in MacOSX-MachO python.
* Fixed changed UPP routines names. The module now compiles and loads.Jack Jansen2001-05-221-3/+7
|
* Move the sha tests to PyUnit.Fred Drake2001-05-222-22/+20
|
* Convert binhex regression test to PyUnit. We could use a better testFred Drake2001-05-221-40/+38
| | | | for this.
* SF patch #425242: Patch which "inlines" small dictionaries.Tim Peters2001-05-221-81/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is Marc-Andre Lemburg's, the implementation is Tim's. Add a new ma_smalltable member to dictobjects, an embedded vector of MINSIZE (8) dictentry structs. Short course is that this lets us avoid additional malloc(s) for dicts with no more than 5 entries. The changes are widespread but mostly small. Long course: WRT speed, all scalar operations (getitem, setitem, delitem) on non-empty dicts benefit from no longer needing NULL-pointer checks (ma_table is never NULL anymore). Bulk operations (copy, update, resize, clearing slots during dealloc) benefit in some cases from now looping on the ma_fill count rather than on ma_size, but that was an unexpected benefit: the original reason to loop on ma_fill was to let bulk operations on empty dicts end quickly (since the NULL-pointer checks went away, empty dicts aren't special-cased any more). Special considerations: For dicts that remain empty, this change is a lose on two counts: the dict object contains 8 new dictentry slots now that weren't needed before, and dict object creation also spends time memset'ing these doomed-to-be-unsused slots to NULLs. For dicts with one or two entries that never get larger than 2, it's a mix: a malloc()/free() pair is no longer needed, and the 2-entry case gets to use 8 slots (instead of 4) thus decreasing the chance of collision. Against that, dict object creation spends time memset'ing 4 slots that aren't strictly needed in this case. For dicts with 3 through 5 entries that never get larger than 5, it's a pure win: the dict is created with all the space they need, and they never need to resize. Before they suffered two malloc()/free() calls, plus 1 dict resize, to get enough space. In addition, the 8-slot table they ended with consumed more memory overall, because of the hidden overhead due to the additional malloc. For dicts with 6 or more entries, the ma_smalltable member is wasted space, but then these are large(r) dicts so 8 slots more or less doesn't make much difference. They still benefit all the time from removing ubiquitous dynamic null-pointer checks, and get a small benefit (but relatively smaller the larger the dict) from not having to do two mallocs, two frees, and a resize on the way *to* getting their sixth entry. All in all it appears a small but definite general win, with larger benefits in specific cases. It's especially nice that it allowed to get rid of several branches, gotos and labels, and overall made the code smaller.
* Convert copy_reg test to PyUnit.Fred Drake2001-05-221-29/+19
|
* Remove unused import.Fred Drake2001-05-221-1/+0
|
* Simple conversion to PyUnit -- this test really needs more work!Fred Drake2001-05-221-9/+14
|
* Convert dospath test suite to PyUnit, adding a couple more cases forFred Drake2001-05-221-46/+55
| | | | isabs() (no false results were checked) and splitdrive().
* Re-write the rfc822 tests to use PyUnit.Fred Drake2001-05-221-138/+162
| | | | | Update to reflect using "" as the default value for the second parameter to the get() method.
* Per discussion with Barry, make the default value for both get() andFred Drake2001-05-221-5/+4
| | | | | | setdefault() the empty string. In setdefault(), use + to join the value to create the entry for the headers attribute so that TypeError is raised if the value is of the wrong type.