summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Coredumpers from Michael Hudson, mutating dicts while printing orTim Peters2001-06-022-8/+84
| | | | | converting to string. Critical bugfix candidate -- if you take this seriously <wink>.
* Separate CFLAGS and CPPFLAGS. CFLAGS should not contain preprocessorNeil Schemenauer2001-06-027-12/+19
| | | | directives, which is the role of CPPFLAGS. Closes SF patch #414991.
* dict_popitem(): Repaired last-second 2.1 comment, which misidentified theTim Peters2001-06-021-5/+8
| | | | true reason for allocating the tuple before checking the dict size.
* New collision resolution scheme: no polynomials, simpler, faster, lessTim Peters2001-06-022-171/+130
| | | | | | | code, less memory. Tests have uncovered no drawbacks. Christian and Vladimir are the other two people who have burned many brain cells on the dict code in recent years, and they like the approach too, so I'm checking it in without further ado.
* more public symbols for __all__Skip Montanaro2001-06-011-1/+6
|
* Document os.getenv().Fred Drake2001-05-311-0/+7
| | | | This closes SF bug #429059.
* Some general cleanup of the threading module documentation, includingFred Drake2001-05-311-25/+15
| | | | | | fixing the reference to Thread.getDeamon() (should be isDaemon()). This closes SF bug #429070.
* PyErr_Occurred(): Use PyThreadState_GET(), which saves a tiny function callTim Peters2001-05-301-1/+1
| | | | | | | | in release builds. Suggested by Martin v. Loewis. I'm half tempted to macroize PyErr_Occurred too, as the whole thing could collapse to just _PyThreadState_Current->curexc_type
* Added entry for HTMLParser documentation.Fred Drake2001-05-302-0/+2
|
* Michel Pelletier <michel@digicool.com>:Fred Drake2001-05-301-0/+136
| | | | Documentation for the HTMLParser module, with small changes by FLD.
* This division test was too stringent in its accuracy expectations forTim Peters2001-05-291-4/+4
| | | | | | | random inputs: if you ran the test 100 times, you could expect it to report a bogus failure. So loosened its expectations. Also changed the way failing tests are printed, so that when run under regrtest.py we get enough info to reproduce the failure.
* BadDictKey test: The output file expected "raising error" to be printedTim Peters2001-05-291-1/+10
| | | | | | | | | | | exactly once. But the test code can't know that, as the number of times __cmp__ is called depends on internal details of the dict implementation. This is especially nasty because the __hash__ method returns the address of the class object, so the hash codes seen by the dict can vary across runs, causing the dict to use a different probe order across runs. I just happened to see this test fail about 1 run in 7 today, but only under a release build and when passing -O to Python. So, changed the test to be predictable across runs.
* New solution to the "Someone stuck a colon in that filename!" problem:Fred Drake2001-05-291-3/+10
| | | | | Allow colons in the labels used for internal references, but do not expose them when generating filename.
* Users of PySequence_GET_FAST() should get the length of the sequence usingFred Drake2001-05-291-1/+1
| | | | | | | PySequence_Size(), not PyObject_Size(): the later considers the mapping methods as well as the sequence methods, which is not needed here. Either should be equally fast in this case, but PySequence_Size() offers a better conceptual match.
* readlink() description: Added note that the return value may be eitherFred Drake2001-05-291-5/+20
| | | | | | | | | | absolute or relative. remove(), rename() descriptions: Give more information about the cross- platform behavior of these functions, so single-platform developers can be aware of the potential issues when writing portable code. This closes SF patch #426598.
* Change cascaded if stmts to switch stmt in vgetargs1().Jeremy Hylton2001-05-291-19/+25
| | | | | | | | In the default branch, keep three ifs that are used if level == 0, the most common case. Note that first if here is a slight optimization for the 'O' format. Second part of SF patch 426072.
* Internal refactoring of convertsimple() and friends.Jeremy Hylton2001-05-291-515/+514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that lots of code was re-indented. Replace two-step of convertsimple() and convertsimple1() with convertsimple() and helper converterr(), which is called to format error messages when convertsimple() fails. The old code did all the real work in convertsimple1(), but deferred error message formatting to conversimple(). The result was paying the price of a second function call on every call just to format error messages in the failure cases. Factor out of the buffer-handling code in convertsimple() and package it as convertbuffer(). Add two macros to ease readability of Unicode coversions, UNICODE_DEFAULT_ENCODING() and CONV_UNICODE, an error string. The convertsimple() routine had awful indentation problems, primarily because there were two tabs between the case line and the body of the case statements. This patch reformats the entire function to have a single tab between case line and case body, which makes the code easier to read (and consistent with ceval). The introduction of converterr() exacerbated the problem and prompted this fix. Also, eliminate non-standard whitespace after opening paren and before closing paren in a few if statements. (This checkin is part of SF patch 426072.)
* fix bogus indentationJeremy Hylton2001-05-291-1/+1
|
* runtest(): When generating output, if the result is a single line with theFred Drake2001-05-291-1/+19
| | | | | | name of the test, only write the output file if it already exists (and tell the user to consider removing it). This avoids the generation of unnecessary turds.
* The one-line output files are no longer needed, so do not keep them.Fred Drake2001-05-291-1/+0
|
* Variety of test cases for call to builtin functionsJeremy Hylton2001-05-292-0/+126
|
* Fix bug reported by Tim Peters on python-dev:Jeremy Hylton2001-05-291-6/+5
| | | | | | | | | | | | | | | Keyword arguments passed to builtin functions that don't take them are ignored. >>> {}.clear(x=2) >>> instead of >>> {}.clear(x=2) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: clear() takes no keyword arguments
* 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.