summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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
|