summaryrefslogtreecommitdiffstats
path: root/Objects
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-071-15/+184
| | | | | | 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.
* 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.
* 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).
* 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
|
* 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-031-13/+8
| | | | | | | | | | | | | | | | 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.
* Add garbage collection for module objects. Closes patch #102939 andNeil Schemenauer2001-01-021-2/+27
| | | | fixes bug #126345.
* Make the indentation consistently use tabs instead of using spaces justFred Drake2000-12-201-3/+3
| | | | in one place.
* Patch #102940: use only printable Unicode chars in reportingAndrew M. Kuchling2000-12-191-1/+2
| | | | | incorrect % characters; characters outside the printable range are replaced with '?'
* Patch #102868 from cgw: fix memory leak when an EOF is encounteredAndrew M. Kuchling2000-12-191-0/+3
| | | | using GNU libc's getline()
* Fix off-by-one error in split_substring(). Fixes SF bug #122162.Guido van Rossum2000-12-191-1/+1
|
* [ Patch #102852 ] Make % error a bit more informative by indicates theAndrew M. Kuchling2000-12-152-4/+6
| | | | index at which an unknown %-escape was found
* Test for NULL returned from PyObject_NEW().Guido van Rossum2000-12-141-0/+3
|
* Test for NULL returned from PyObject_NEW().Guido van Rossum2000-12-141-0/+3
|
* Add long-overdue docstrings to dict methods.Tim Peters2000-12-131-11/+53
|
* Use METH_VARARGS instead of "1" in list method table.Tim Peters2000-12-131-9/+9
|
* Typo repair in comments. Fell for GregS's .popitem() poke.Tim Peters2000-12-131-2/+6
|
* Bring comments up to date (e.g., they still said the table had to beTim Peters2000-12-131-23/+40
| | | | a prime size, which is in fact never true anymore ...).
* Add popitem() -- SF patch #102733.Guido van Rossum2000-12-121-0/+53
|
* Jeffrey D. Collins <tokeneater@users.sourceforge.net>:Fred Drake2000-12-061-3/+3
| | | | | | Fix type of the self parameter to some string object methods. This closes patch #102670.
* Backing out my changes.Moshe Zadka2000-11-301-72/+0
| | | | Improved version coming soon to a Source Forge near you!
* Only use getline() when compiling using glibcAndrew M. Kuchling2000-11-301-1/+1
|
* Added .first{item,value,key}() to dictionaries.Moshe Zadka2000-11-301-0/+72
| | | | | Complete with docos and tests. OKed by Guido.
* Fox for SF bug #123859: %[duxXo] long formats inconsistent.Tim Peters2000-11-302-7/+2
|
* Patch #102469: Use glibc's getline() extension when reading unbounded linesAndrew M. Kuchling2000-11-291-3/+30
|
* Update dependencies per /F.Guido van Rossum2000-11-281-1/+1
|
* SF patch #102548, fix for bug #121013, by mwh@users.sourceforge.net.Guido van Rossum2000-11-271-1/+1
| | | | Fixes a typo that caused "".join(u"this is a test") to dump core.
* Added _HAVE_BSDI and __APPLE__ to the list of platforms that require aGuido van Rossum2000-11-131-1/+1
| | | | | hack for TELL64()... Sounds like there's something else going on really. Does anybody have a clue I can buy?
* Fixed support for containment test when a negative step is used; thisFred Drake2000-11-081-8/+34
| | | | | | | *really* closes bug #121965. Added three attributes to the xrange object: start, stop, and step. These are the same as for the slice objects.
* In the containment test, get the boundary condition right. ">" was usedFred Drake2000-11-081-2/+2
| | | | | | where ">=" should have been. This closes bug #121965.
* Added 38,642 missing characters to the Unicode database (first-lastFredrik Lundh2000-11-031-87/+86
| | | | | | | ranges) -- but thanks to the 2.0 compression scheme, this doesn't add a single byte to the resulting binaries (!) Closes bug #117524
* Ka-Ping Yee <ping@lfw.org>:Fred Drake2000-10-248-29/+52
| | | | | | Changes to error messages to increase consistency & clarity. This (mostly) closes SourceForge patch #101839.
* [ Bug #116174 ] using %% in cstrings sometimes fails with unicode paramsFix ↵Marc-André Lemburg2000-10-071-11/+17
| | | | | | | for the bug reported in Bug #116174: "%% %s" % u"abc" failed due to the way string formatting delegated work to the Unicode formatting function.
* Donn Cave <donn@oz.net>:Fred Drake2000-10-061-0/+2
| | | | | | | Fix large file support for BeOS. This closes SourceForge patch #101773. Refer to the patch discussion for information on possible alternate fixes.
* SF bug 115831 and Ping's SF patch 101751, 0.0**-2.0 returns inf rather thanTim Peters2000-10-063-32/+47
| | | | | | | | | | raise ValueError. Checked in the patch as far as it went, but also changed all of ints, longs and floats to raise ZeroDivisionError instead when raising 0 to a negative number. This is what 754-inspired stds require, as the "true result" is an infinity obtained from finite operands, i.e. it's a singularity. Also changed float pow to not be so timid about using its square-and-multiply algorithm. Note that what math.pow does is unrelated to what builtin pow does, and will still vary by platform.
* Simplify _PyTuple_Resize by not using the tuple free list and droppingNeil Schemenauer2000-10-051-86/+24
| | | | | support for the last_is_sticky flag. A few hard to find bugs may be fixed by this patch since the old code was buggy.
* Fix for SF bug #115987: PyInstance_HalfBinOp does not initialize theThomas Wouters2000-10-051-11/+11
| | | | | | result-object-pointer that is passed in, when an exception occurs during coercion. The pointer has to be explicitly initialized in the caller to avoid putting trash on the Python stack.
* Move LONG_BIT from intobject.c to pyport.h. #error if it's already beenTim Peters2000-10-051-8/+0
| | | | | | #define'd to an unreasonable value (several recent gcc systems have misdefined it, causing bogus overflows in integer multiplication). Nuke CHAR_BIT entirely.
* - fix a GC bug caused by malloc() failingNeil Schemenauer2000-10-041-1/+1
|
* _PyUnicode_Fini(): Initialize the local freelist walking variable `u'Barry Warsaw2000-10-031-2/+3
| | | | | | after unicode_empty has been freed, otherwise it might not point to the real start of the unicode_freelist. Final closure for SF bug #110681, Jitterbug PR#398.
* In _PyUnicode_Fini(), decref unicode_empty before tearng down the freeGuido van Rossum2000-10-031-2/+2
| | | | list. Discovered by Barry, fix approved by MAL.
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-268-67/+1
| | | | | | | | Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.