- 29 May, 2001 18 commits
-
-
Fred Drake authored
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.
-
Jeremy Hylton authored
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.
-
Jeremy Hylton authored
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.)
-
Jeremy Hylton authored
-
Fred Drake authored
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.
-
Fred Drake authored
-
Jeremy Hylton authored
-
Jeremy Hylton authored
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
-
Fred Drake authored
was not available in Python 1.5.1. (Yes, a user actually tried to use this with that version of Python!)
-
Fred Drake authored
__hash__() up to date (re: use of objects which define these methods as dictionary keys). This closes SF bug #427698.
-
Fred Drake authored
-
Fred Drake authored
optional in the documentation. This closes SF bug #427985.
-
Fred Drake authored
Added information on PyIter_Check(), PyIter_Next(), PyObject_Unicode(), PyString_AsDecodedObject(), PyString_AsEncodedObject(), and PyThreadState_GetDict().
-
Fred Drake authored
error.
-
Fred Drake authored
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.
-
Thomas Wouters authored
suggestion (modulo style).
-
Tim Peters authored
-
Tim Peters authored
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 ...
-
- 28 May, 2001 2 commits
-
-
Tim Peters authored
_PyTuple_Resize().
-
Thomas Wouters authored
Instead of raising a SystemError, just create a new tuple of the desired size. This fixes (at least) SF bug #420343.
-
- 27 May, 2001 1 commit
-
-
Tim Peters authored
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.
-
- 26 May, 2001 4 commits
-
-
Jack Jansen authored
stdout as the prompt. This makes raw_input() and print "xxx", ; sys.stdin.readline() work a bit more palatable.
-
Tim Peters authored
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.
-
Tim Peters authored
multi-argument list.append(1, 2, 3) (as opposed to .append((1,2,3))).
-
Tim Peters authored
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).
-
- 25 May, 2001 2 commits
-
-
Fred Drake authored
to end up with the information, it is better recorded than lost.
-
Fred Drake authored
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.
-
- 24 May, 2001 3 commits
-
-
Barry Warsaw authored
there were multiple translatable strings on a single line of source code.
-
Martin v. Löwis authored
Use new _PyString_Eq in lookdict_string.
-
Tim Peters authored
they're entirely full. Not a question of correctness, but of temporarily misplaced common sense.
-
- 23 May, 2001 9 commits
-
-
Tim Peters authored
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.
-
Jack Jansen authored
-
Barry Warsaw authored
tuples by filename/lineno, then sort the catalog entries by their location tuples.
-
Guido van Rossum authored
tabs. The title was centered using 8-byte tabs, however, and the result looked strange. Fixed this.
-
Jack Jansen authored
-
Tim Peters authored
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.
-
Fred Drake authored
testing using doctest and PyUnit.
-
Fred Drake authored
-
Tim Peters authored
generating it. Since this is purely a doctest, the output file never served a good purpose.
-
- 22 May, 2001 1 commit
-
-
Guido van Rossum authored
-