summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fiddled ms_getline_hack after talking w/ Guido: made clearer that theTim Peters2001-01-081-65/+67
| | | | | | | | | | | | | code duplication is to let us get away without a realloc whenever possible; boosted the init buf size (the cutoff at which we *can* get away without a realloc) from 100 to 200 so that more files can enjoy this boost; and allowed other threads to run in all cases. The last two cost something, but not significantly: in my fat test case, less than a 1% slowdown total. Since my test case has a great many short lines, that's probably the worst slowdown, too. While the logic barely changed, there were lots of edits. This also gets rid of the reference to fp->_cnt, so the last platform assumption being made here is that fgets doesn't overwrite bytes capriciously (== beyond the terminating null byte it must write).
* MS Win32 .readline() speedup, as discussed on Python-Dev. This is a trickyTim Peters2001-01-073-15/+245
| | | | | | variant that never needs to "search from the right". Also fixed unlikely memory leak in get_line, if string size overflows INTMAX. Also new std test test_bufio to make sure .readline() works.
* Tim noticed that I had botched get_line_raw(). Looking again, IGuido van Rossum2001-01-071-47/+30
| | | | | | realized that this behavior is already present in PyFile_GetLine(), which is the only place that needs it. A little refactoring of that function made get_line_raw() redundant.
* Add more regression tests, including for the import statement variations.Fred Drake2001-01-072-10/+60
| | | | | These will detect regression on SF bug #127271 and other import statement bugs.
* Fix problems with validation of import statement parse trees.Fred Drake2001-01-071-5/+24
| | | | This closes SF bug #127271.
* This patch adds a new feature to the builtin charmap codec:Marc-André Lemburg2001-01-062-0/+66
| | | | | | | | | | | | | | | the mapping dictionaries can now contain 1-n mappings, meaning that character ordinals may be mapped to strings or Unicode object, e.g. 0x0078 ('x') -> u"abc", causing the ordinal to be replaced by the complete string or Unicode object instead of just one character. Another feature introduced by the patch is that of mapping oridnals to the emtpy string. This allows removing characters. The patch is different from patch #103100 in that it does not cause a performance hit for the normal use case of 1-1 mappings. Written by Marc-Andre Lemburg, copyright assigned to Guido van Rossum.
* This patch adds a new feature to the builtin charmap codec:Marc-André Lemburg2001-01-061-8/+48
| | | | | | | | | | | | | | | The mapping dictionaries can now contain 1-n mappings, meaning that character ordinals may be mapped to strings or Unicode object, e.g. 0x0078 ('x') -> u"abc", causing the ordinal to be replaced by the complete string or Unicode object instead of just one character. Another feature introduced by the patch is that of mapping oridnals to the emtpy string. This allows removing characters. The patch is different from patch #103100 in that it does not cause a performance hit for the normal use case of 1-1 mappings. Written by Marc-Andre Lemburg, copyright assigned to Guido van Rossum.
* Added "repeat.py" -- repeatedly execute a shell command (likeGuido van Rossum2001-01-052-7/+64
| | | | watch(1)). Updated and untabified the README file.
* Configuration test for working getc_unlocked() (and flockfile() andGuido van Rossum2001-01-054-4/+64
| | | | funlockfile()).
* Speed it up by using readlines(sizehint). It's still slower thanGuido van Rossum2001-01-051-10/+39
| | | | | | | other ways of reading input. :-( In the process, I added an optional bufsize argument to the input() function and the FileInput class.
* Restructured get_line() for clarity and speed.Guido van Rossum2001-01-051-66/+59
| | | | | | | - The raw_input() functionality is moved to a separate function. - Drop GNU getline() in favor of getc_unlocked(), which exists on more platforms (and is even a tad faster on my system).
* Clarification of new bisect module functions.Tim Peters2001-01-051-1/+2
|
* Update explanation of the set_location() method to indicate that inFred Drake2001-01-051-1/+7
| | | | | | | BTree databases, the key need not be in the database. Also, tell about the exception if the key is not in the DB for other DB types. This closes SF bug #127377.
* Add test cases based on RFC 1808. So now we actually have a test suiteFred Drake2001-01-052-0/+106
| | | | | | | the urljoin() function, which exercises the urlparse() and urlunparse() functions as side effects. (Moshe, why did we have perfectly empty tests checked in for this?)
* urlunparse(): Do not add a leading slash to the path if it is empty.Fred Drake2001-01-051-6/+12
| | | | | | | | | urljoin(): Make this conform to RFC 1808 for all examples given in that RFC (both "Normal" and "Abnormal"), so long as that RFC does not conflict the older RFC 1630, which also specified relative URL resolution. This closes SF bug #110832 (Jitterbug PR#194).
* Fix signed/unsigned wng. Unfortunately, (unsigned char) << intTim Peters2001-01-051-2/+2
| | | | has type int in C.
* When a PyCFunction that takes only positional parameters is called withFred Drake2001-01-043-19/+41
| | | | | | | | | | an empty keywords dictionary (via apply() or the extended call syntax), the keywords dict should be ignored. If the keywords dict is not empty, TypeError should be raised. (Between the restructuring of the call machinery and this patch, an empty dict in this situation would trigger a SystemError via PyErr_BadInternalCall().) Added regression tests to detect errors for this.
* Recognize pyc files even if they don't end in pyc.Martin v. Löwis2001-01-042-7/+41
| | | | Patch #103067 with modifications as discussed in email.
* Fix the bugfix for SF bug #127151 -- make sure we map "previous_page" toFred Drake2001-01-041-0/+7
| | | | "previous" and "next_page" to "next". This way the proper icons are found.
* __rcmp__() description: Changed to indicate that this is no longerFred Drake2001-01-041-8/+1
| | | | | | | | supported as of Python 2.1. We still need to have an entry for this since it is reasonable for users to want to understand existing code. This closes SF bug #122715.
* Based on comments from Guido, do not describe bisect() and insert() asFred Drake2001-01-041-5/+5
| | | | | | being "for backward compatibility." Also revert to using bisect() in the example, since Guido thinks that is the best recommendation for typical usage.
* Markup nit: Command line options should be marked with \programopt.Fred Drake2001-01-041-15/+17
| | | | | | Other minor markup nits fixed. Make reference to PyErr_Warn() a hyperlink.
* Markup nit: Command line options should be marked with \programopt.Fred Drake2001-01-041-2/+2
|
* Fix typo spotted by Detlef Lannert <lannert@users.sourceforge.net>.Fred Drake2001-01-041-1/+1
|
* Added information about the interaction of opening a file in append modeFred Drake2001-01-041-1/+6
| | | | | | and seek() in the description of seek(). This closes SF bug #126850.
* Markup nit: OK and ERR should be marked \constant in running text.Fred Drake2001-01-041-3/+2
|
* Update documentation to include the new functions, and use the moreFred Drake2001-01-041-13/+40
| | | | | | explicitly-named bisect_right() in the example code. This closes SF bug #127055.
* Description of long(): A string parameter is no longer required to beFred Drake2001-01-041-1/+1
| | | | | | *decimal*. This closes SF bug #127273.
* Add NotImplemented to the builtin module.Neil Schemenauer2001-01-041-0/+3
|
* Changes for PEP 208. PyObject_Compare has been rewritten. Instances noNeil Schemenauer2001-01-041-118/+139
| | | | longer get special treatment. The Py_NotImplemented type is here as well.
* Make long a new style number type. Sequence repeat is now done hereNeil Schemenauer2001-01-041-76/+262
| | | | now as well.
* Make int a new style number type. Sequence repeat is now done hereNeil Schemenauer2001-01-041-64/+116
| | | | now as well.
* Make float a new style number type.Neil Schemenauer2001-01-041-42/+108
|
* Make instances a new style number type. See PEP 208 for details. InstanceNeil Schemenauer2001-01-041-184/+268
| | | | | types no longer get special treatment from abstract.c so more number number methods have to be implemented.
* Massive changes as per PEP 208. Read it for details.Neil Schemenauer2001-01-041-728/+318
|
* No more RCmp.Neil Schemenauer2001-01-041-22/+1
|
* Sequence repeat works now for in-place multiply with an integer typeNeil Schemenauer2001-01-041-4/+4
| | | | as the left operand. I don't know if this is a feature or a bug.
* __rcmp__ no longer gets called on instances. Remove the test for it.Neil Schemenauer2001-01-041-12/+1
|
* Numbers no longer compare smaller than all other types. Fix the onlyNeil Schemenauer2001-01-041-1/+2
| | | | part of the testsuite that breaks. The old behavior may be restored.
* - Add nb_cmp slot for new style nubmers.Neil Schemenauer2001-01-041-0/+22
| | | | | - Define type flag for new style numbers. - Add Py_NotImplemented.
* Remove PyInstance_*BinOp functions.Neil Schemenauer2001-01-041-8/+0
|
* Document the NotImplemented object.Neil Schemenauer2001-01-041-0/+9
|
* Patch #103012: Update fpectlmodule for current glibc;Andrew M. Kuchling2001-01-041-0/+7
| | | | | The _setfpucw() function/macro doesn't seem to exist any more; instead there's an _FPU_SETCW macro.
* Actually call the object with an __call__ method, instead of justJeremy Hylton2001-01-031-0/+1
| | | | | checking if it is callable. This is the only place in the test suite where an __call__ method is called.
* Revised implementation of CALL_FUNCTION and friends.Jeremy Hylton2001-01-031-296/+429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More revision still needed. Much of the code that was in the mainloop was moved to a series of helper functions. PyEval_CallObjectWithKeywords was split into two parts. The first part now only does argument handling. The second part is now named call_object and delegates the call to a call_(function,method,etc.) helper. XXX The call_XXX helper functions should be replaced with tp_call functions for the respective types. The CALL_FUNCTION implementation contains three kinds of optimization: 1. fast_cfunction and fast_function are called when the arguments on the stack can be passed directly to eval_code2() without copying them into a tuple. 2. PyCFunction objects are dispatched immediately, because they are presumed to occur more often than anything else. 3. Bound methods are dispatched inline. The method object contains a pointer to the function object that will be called. The function is called from within the mainloop, which may allow optimization #1 to be used, too. The extened call implementation -- f(*args) and f(**kw) -- are implemented as a separate case in the mainloop. This allows the common case of normal function calls to execute without wasting time on checks for extended calls, although it does introduce a small amount of code duplication. Also, the unused final argument of eval_code2() was removed. This is probably the last trace of the access statement :-).
* Two new names.Guido van Rossum2001-01-031-0/+2
|
* New, improved README from Mike Clarkson. Wow!Guido van Rossum2001-01-031-20/+143
|
* dict_update has two boundary conditions: a.update(a) and a.update({})Jeremy Hylton2001-01-031-2/+2
| | | | Added test for second one.
* fix leakJeremy Hylton2001-01-031-1/+3
|
* This patch changes the default behaviour of the builtin charmapMarc-André Lemburg2001-01-0356-293/+424
| | | | | | | | | | | | | | | | codec to not apply Latin-1 mappings for keys which are not found in the mapping dictionaries, but instead treat them as undefined mappings. The patch was originally written by Martin v. Loewis with some additional (cosmetic) changes and an updated test script by Marc-Andre Lemburg. The standard codecs were recreated from the most current files available at the Unicode.org site using the Tools/scripts/gencodec.py tool. This patch closes the bugs #116285 and #119960.