summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Plug a memory leak in list(), when appending to the result list.Tim Peters2001-05-021-5/+9
|
* Whitespace normalization.Tim Peters2001-05-022-3/+3
|
* Added tests for Weak*Dictionary iterator support.Fred Drake2001-05-021-10/+54
| | | | Refactored some object initialization to be more reusable.
* Added iterator support to the Weak*Dictionary classes.Fred Drake2001-05-021-0/+73
|
* Add more news about iterators.Guido van Rossum2001-05-011-0/+12
|
* Generalize list(seq) to work with iterators. This also generalizes list()Tim Peters2001-05-013-31/+99
| | | | | | | | | | | | | to no longer insist that len(seq) be defined. NEEDS DOC CHANGES. This is meant to be a model for how other functions of this ilk (max, filter, etc) can be generalized similarly. Feel encouraged to grab your favorite and convert it! Note some cute consequences: list(file) == file.readlines() == list(file.xreadlines()) list(dict) == dict.keys() list(dict.iteritems()) = dict.items() list(xrange(i, j, k)) == range(i, j, k)
* Discard a misleading comment about iter_iternext().Guido van Rossum2001-05-011-1/+0
|
* Printing objects to a real file still wasn't done right: if theGuido van Rossum2001-05-011-32/+14
| | | | | | | | | | | | | | | | | | | object's type didn't define tp_print, there were still cases where the full "print uses str() which falls back to repr()" semantics weren't honored. This resulted in >>> print None <None object at 0x80bd674> >>> print type(u'') <type object at 0x80c0a80> Fixed this by always using the appropriate PyObject_Repr() or PyObject_Str() call, rather than trying to emulate what they would do. Also simplified PyObject_Str() to always fall back on PyObject_Repr() when tp_str is not defined (rather than making an extra check for instances with a __str__ method). And got rid of the special case for strings.
* Add a proper implementation for the tp_str slot (returning self, ofGuido van Rossum2001-05-011-1/+8
| | | | | course), so I can get rid of the special case for strings in PyObject_Str().
* Add experimental iterkeys(), itervalues(), iteritems() to dictGuido van Rossum2001-05-011-11/+85
| | | | | | | objects. Tests show that iteritems() is 5-10% faster than iterating over the dict and extracting the value with dict[key].
* Well darnit! The innocuous fix I made to PyObject_Print() causedGuido van Rossum2001-04-301-1/+20
| | | | printing of instances not to look for __str__(). Fix this.
* SF bug #417093: Case sensitive import: dir and .py file w/ same nameTim Peters2001-04-291-8/+5
| | | | | | | | | | | | | | | | Directory containing Spam.py spam/__init__.py Then "import Spam" caused a SystemError, because code checking for the existence of "Spam/__init__.py" finds it on a case-insensitive filesystem, but then bails because the directory it finds it in doesn't match case, and then old code assumed that was still an error even though it isn't anymore. Changed the code to just continue looking in this case (instead of calling it an error). So import Spam and import spam both work now.
* Fix buglet reported on c.l.py: map(fnc, file.xreadlines()) blows up.Tim Peters2001-04-281-9/+19
| | | | | | | | | Also a 2.1 bugfix candidate (am I supposed to do something with those?). Took away map()'s insistence that sequences support __len__, and cleaned up the convoluted code that made it *look* like it really cared about __len__ (in fact the old ->len field was only *used* as a flag bit, as the main loop only looked at its sign bit, setting the field to -1 when IndexError got raised; renamed the field to ->saw_IndexError instead).
* A different approach to the problem reported inTim Peters2001-04-282-37/+54
| | | | | | | | | | | Patch #419651: Metrowerks on Mac adds 0x itself C std says %#x and %#X conversion of 0 do not add the 0x/0X base marker. Metrowerks apparently does. Mark Favas reported the same bug under a Compaq compiler on Tru64 Unix, but no other libc broken in this respect is known (known to be OK under MSVC and gcc). So just try the damn thing at runtime and see what the platform does. Note that we've always had bugs here, but never knew it before because a relevant test case didn't exist before 2.1.
* (Adding this to the trunk as well.)Guido van Rossum2001-04-271-1/+4
| | | | | | | | Fix a very old flaw in PyObject_Print(). Amazing! When an object type defines tp_str but not tp_repr, 'print x' to a real file object would not call the tp_str slot but rather print a default style representation: <foo object at 0x....>. This even though 'print x' to a file-like-object would correctly call the tp_str slot.
* Got rid of the whole event filtering mess again, I can't get it to work. ↵Jack Jansen2001-04-271-23/+1
| | | | Simply disabling the Tk event handling hook in _tkinter is not as nice, but at least it works.
* Fix 2.1 nested scopes crash reported by Evan SimpsonJeremy Hylton2001-04-273-6/+32
| | | | | | | | The new test case demonstrates the bug. Be more careful in symtable_resolve_free() to add a var to cells or frees only if it won't be added under some other rule. XXX Add new assertion that will catch this bug.
* improved error message-- names the type of the unexpected objectJeremy Hylton2001-04-271-2/+3
|
* Apparently the code to forestall Tk eating events was too aggressive (Tk ↵Jack Jansen2001-04-261-5/+5
| | | | user input stopped working). Fixed (I hope:-).
* Added more help, and recovery from misspelled sort key arguments.Eric S. Raymond2001-04-261-2/+19
|
* Files for 2.1 distribution.Jack Jansen2001-04-2516-65/+111
|
* Check RefCon backpointer to python object with IsPointerValid() before ↵Jack Jansen2001-04-252-2/+4
| | | | dereferencing it (carbon only).
* Updated copyright info (which was long due).Jack Jansen2001-04-252-2/+2
|
* - Raise console window on input. Fixes Carbon hang.Jack Jansen2001-04-252-1/+2
|
* - Raise console window on input. Fixes Carbon hang.Jack Jansen2001-04-253-4/+32
| | | | | - Better handling of menu bar save/restore. - Override abort() so it honours the "keep console window" flag.
* Don't crash if InfoScrap doesn't exist (as is the case in Carbon).Jack Jansen2001-04-251-2/+5
|
* Correct two floating-point representations printed by the interpreter inFred Drake2001-04-251-2/+2
| | | | interactive examples. Error noted by Dinu Gherman.
* Update test to accomodate the change to the namespace_separator parameterFred Drake2001-04-252-10/+32
| | | | | | | of ParserCreate(). Added assignment tests for the ordered_attributes and specified_attributes values, similar to the checks for the returns_unicode attribute.
* ParserCreate(): Allow an empty string for the namespace_separator argument;Fred Drake2001-04-251-68/+82
| | | | | | | | | | | | while not generally a good idea, this is used by RDF users, and works to implement RDF-style namespace+localname concatenation as defined in the RDF specifications. (This also corrects a backwards-compatibility bug.) Be more conservative while clearing out handlers; set the slot in the self->handlers array to NULL before DECREFing the callback. Still more adjustments to make the code style internally consistent.
* SF bug 418615: regular expression bug in pipes.py.Tim Peters2001-04-251-4/+4
| | | | | | | | Obviously bad regexps, spotted by Jeffery Collins. HELP! I can't run this on Windows, and the module test() function probably doesn't work on anyone's box. Could a Unixoid please write an at least minimal working test and add it to the std test suite?
* SF bug 418296: WinMain.c should use WIN32_LEAN_AND_MEAN.Tim Peters2001-04-242-1/+2
| | | | | I believe Kevin Rodgers here! The old WINDOWS_LEAN_AND_MEAN has, AFAICT, always been wrong.
* Fix typo in docstringAndrew M. Kuchling2001-04-231-1/+1
|
* Bump version # for final releaseAndrew M. Kuchling2001-04-231-1/+1
|
* This patch originated from an idea by Martin v. Loewis who submitted aMarc-André Lemburg2001-04-233-54/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch for sharing single character Unicode objects. Martin's patch had to be reworked in a number of ways to take Unicode resizing into consideration as well. Here's what the updated patch implements: * Single character Unicode strings in the Latin-1 range are shared (not only ASCII chars as in Martin's original patch). * The ASCII and Latin-1 codecs make use of this optimization, providing a noticable speedup for single character strings. Most Unicode methods can use the optimization as well (by virtue of using PyUnicode_FromUnicode()). * Some code cleanup was done (replacing memcpy with Py_UNICODE_COPY) * The PyUnicode_Resize() can now also handle the case of resizing unicode_empty which previously resulted in an error. * Modified the internal API _PyUnicode_Resize() and the public PyUnicode_Resize() API to handle references to shared objects correctly. The _PyUnicode_Resize() signature changed due to this. * Callers of PyUnicode_FromUnicode() may now only modify the Unicode object contents of the returned object in case they called the API with NULL as content template. Note that even though this patch passes the regression tests, there may still be subtle bugs in the sharing code.
* Mondo changes to the iterator stuff, without changing how Python codeGuido van Rossum2001-04-239-58/+182
| | | | | | | | | | | | | | | | | | | | | | | | sees it (test_iter.py is unchanged). - Added a tp_iternext slot, which calls the iterator's next() method; this is much faster for built-in iterators over built-in types such as lists and dicts, speeding up pybench's ForLoop with about 25% compared to Python 2.1. (Now there's a good argument for iterators. ;-) - Renamed the built-in sequence iterator SeqIter, affecting the C API functions for it. (This frees up the PyIter prefix for generic iterator operations.) - Added PyIter_Check(obj), which checks that obj's type has a tp_iternext slot and that the proper feature flag is set. - Added PyIter_Next(obj) which calls the tp_iternext slot. It has a somewhat complex return condition due to the need for speed: when it returns NULL, it may not have set an exception condition, meaning the iterator is exhausted; when the exception StopIteration is set (or a derived exception class), it means the same thing; any other exception means some other error occurred.
* At the suggestion of Peter Funk, document 'key in dict' and 'key notGuido van Rossum2001-04-231-6/+6
| | | | in dict' after has_key(), with a \versionadded{2.2} note.
* Update publish-to-SourceForge scripts to automatically determine if theFred Drake2001-04-222-7/+26
| | | | | branch is the head (development) branch or a maintenance brach, and use the appropriate target directory for each.
* Only document <file>.xreadlines() once; added version annotation.Fred Drake2001-04-221-7/+4
| | | | This closes SF bug #417943.
* Process Setup* files with makesetup in the same order as the makefile.Neil Schemenauer2001-04-212-3/+3
|
* Add test suite for iterators.Guido van Rossum2001-04-212-0/+247
|
* Oops, forgot to merge this from the iter-branch to the trunk.Guido van Rossum2001-04-211-9/+37
| | | | This adds "for line in file" iteration, as promised.
* Give UserDict new __contains__ and __iter__ methods.Tim Peters2001-04-212-1/+19
|
* encode(): Handle Latin-1 input characters better.Fred Drake2001-04-211-3/+7
|
* Add support for <memberline/> (needs markup improvement!).Fred Drake2001-04-211-1/+5
| | | | | | Update <versionadded/> to recent addition of optional explanatory text; make the explanation text take the same attribute name for both <versionadded/> and <versionchanged/>.
* Fix a number of minor markup errors.Fred Drake2001-04-213-7/+7
|
* The (fairly recent) \textasciicircum is not supported by LaTeX2HTML; addFred Drake2001-04-211-0/+1
| | | | support for it here.
* SF bug #417508: 'hypot' not found with Borland C++Build.Tim Peters2001-04-212-0/+3
|
* SF but #417587: compiler warnings compiling 2.1.Tim Peters2001-04-214-8/+1
| | | | Repaired *some* of the SGI compiler warnings Sjoerd Mullender reported.
* Teach Windows about new iterobject.c.Tim Peters2001-04-201-0/+15
|
* Adding iterobject.[ch], which were accidentally not added. Sorry\!Guido van Rossum2001-04-202-0/+201
|