summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make test_coercion.py less sensitive to platform fp quirks. ClosesNeil Schemenauer2004-03-102-333/+348
| | | | SF bug #678265.
* Use memcpy() instead of memmove() when the buffers are known to be distinct.Raymond Hettinger2004-03-101-2/+2
|
* Tidied up the implementations of reversed (including the custom onesRaymond Hettinger2004-03-104-28/+58
| | | | | | | | | | | | | | | | | for xrange and list objects). * list.__reversed__ now checks the length of the sequence object before calling PyList_GET_ITEM() because the mutable could have changed length. * all three implementations are now tranparent with respect to length and maintain the invariant len(it) == len(list(it)) even when the underlying sequence mutates. * __builtin__.reversed() now frees the underlying sequence as soon as the iterator is exhausted. * the code paths were rearranged so that the most common paths do not require a jump.
* Eliminate the double reverse option. It's only use caseRaymond Hettinger2004-03-102-17/+2
| | | | was academic and it was potentially confusing to use.
* Optimize inner loops for subscript, repeat, and concat.Raymond Hettinger2004-03-092-36/+59
|
* Optimize slice assignments.Raymond Hettinger2004-03-091-16/+17
| | | | | | | | | | | | | * Replace sprintf message with a constant message string -- this error message ran on every invocation except straight deletions but it was only needed when the rhs was not iterable. The message was also out-of-date and did not reflect that iterable arguments were allowed. * For inner loops that do not make ref count adjustments, use memmove() for fast copying and better readability. * For inner loops that do make ref count adjustments, speed them up by factoring out the constant structure reference and using vitem[] instead.
* SF Patch #912462: Relocate \end tag to the right place.Hye-Shik Chang2004-03-091-1/+2
| | | | (Submitted by George Yoshida)
* Refactor and optimize code for UNPACK_SEQUENCE.Raymond Hettinger2004-03-081-27/+13
| | | | | | | | | | * Defer error handling for wrong number of arguments to the unpack_iterable() function. Cuts the code size almost in half. * Replace function calls to PyList_Size() and PyTuple_Size() with their smaller and faster macro counterparts. * Move the constant structure references outside of the inner loops.
* Remove calls to currentThread() in _Condition methods that were side-effect.Brett Cannon2004-03-081-2/+0
| | | | | | | | | Side-effects were deemed unnecessary and were causing problems at shutdown time when threads were catching exceptions at start time and then triggering exceptions trying to call currentThread() after gc'ed. Masked the initial exception which was deemed bad. Fixes bug #754449 .
* The copy module now handles sets directly. The __copy__ methods are noRaymond Hettinger2004-03-081-4/+0
| | | | longer needed.
* SF patch #907403: Improvements to cStringIO.writelines()Raymond Hettinger2004-03-081-0/+5
| | | | | | | The writelines() method now accepts any iterable argument and writes the lines one at a time rather than using ''.join(lines) followed by a single write. Results in considerable memory savings and makes the method suitable for use with generator expressions.
* SF patch #907403: Improvements to cStringIO.writelines()Raymond Hettinger2004-03-082-30/+27
| | | | | | | The writelines() method now accepts any iterable argument and writes the lines one at a time rather than using ''.join(lines) followed by a single write. Results in considerable memory savings and makes the method suitable for use with generator expressions.
* Add a highlight theme for builtin keywords. Python Patch 805830 Nigel RoweKurt B. Kaiser2004-03-089-16/+42
| | | | | | | | | | | | M ClassBrowser.py M ColorDelegator.py M EditorWindow.py M NEWS.txt M PyShell.py M TreeWidget.py M config-highlight.def M configDialog.py M configHandler.py
* Removed spurious import statementVinay Sajip2004-03-081-2/+0
|
* Optimize tuple_slice() and make further improvements to list_slice()Raymond Hettinger2004-03-083-18/+28
| | | | | | and list.extend(). Factoring the inner loops to remove the constant structure references and fixed offsets gives speedups ranging from 20% to 30%.
* Refactor the copy dispatcher code in copy.py. Simplifies and shortensRaymond Hettinger2004-03-081-35/+17
| | | | the code by grouping common cases together.
* Small optimizations for list_slice() and list_extend_internal().Raymond Hettinger2004-03-081-9/+20
| | | | | | | | * Using addition instead of substraction on array indices allows the compiler to use a fast addressing mode. Saves about 10%. * Using PyTuple_GET_ITEM and PyList_SET_ITEM is about 7% faster than PySequenceFast_GET_ITEM which has to make a list check on every pass.
* Factor out code common to PyDict_Copy() and PyDict_Merge().Raymond Hettinger2004-03-081-20/+6
|
* Deal with possible case of having time.tzname[1] containing UTC or GMT.Brett Cannon2004-03-071-2/+2
| | | | | | Since it is known ahead of time that UTC and GMT always have no DST adjustment then just set the isdst value to 0 even if tzname[0] == tzname[1] . Fixes bug #897817 .
* SF patch #910929: Optimize list comprehensionsRaymond Hettinger2004-03-076-3/+20
| | | | | Add a new opcode, LIST_APPEND, and apply it to the code generation for list comprehensions. Reduces the per-loop overhead by about a third.
* update version at top of fileSkip Montanaro2004-03-051-2/+2
|
* SF #904720: dict.update should take a 2-tuple sequence like dict.__init_Raymond Hettinger2004-03-0411-55/+91
| | | | | | | | (Championed by Bob Ippolito.) The update() method for mappings now accepts all the same argument forms as the dict() constructor. This includes item lists and/or keyword arguments.
* Special case endpoint access for speed.Raymond Hettinger2004-03-041-10/+18
|
* SF Patch #902444: Use process scope thread on FreeBSD. System scopeHye-Shik Chang2004-03-041-1/+1
| | | | | is too expensive on FreeBSD's KSE threading infrastructure and even test_threadedimport fails on default setting.
* * explain flags in doc stringsSkip Montanaro2004-03-033-15/+37
| | | | | * reverse order of files on the command line in pickle2db.py to make it symmetrical with db2pickle.py in the two-arg case (src, then dest)
* Fixed invalid syntax.Sjoerd Mullender2004-03-033-3/+3
|
* typoSkip Montanaro2004-03-031-1/+1
|
* Added license notices that are required to be included in theRaymond Hettinger2004-03-031-1/+331
| | | | documentation as well as the source code.
* Have strftime() check its time tuple argument to make sure the tuple's valuesBrett Cannon2004-03-026-4/+112
| | | | | | | | | | are within proper boundaries as specified in the docs. This can break possible code (datetime module needed changing, for instance) that uses 0 for values that need to be greater 1 or greater (month, day, and day of year). Fixes bug #897625.
* Replace left(), right(), and __reversed__() with the more general purposeRaymond Hettinger2004-03-014-148/+110
| | | | | | | __getitem__() and __setitem__(). Simplifies the API, reduces the code size, adds flexibility, and makes deques work with bisect.bisect(), random.shuffle(), and random.sample().
* Add pystack definition to Misc/gdbinit with some explanation of its behaviorSkip Montanaro2004-03-013-0/+30
| | | | | and add flag comments to ceval.c and main.c alerting people to the coupling between pystack and the layout of those files.
* Make deque_type static so namespace is not polluted.Neal Norwitz2004-02-291-2/+2
|
* Cleanup: remove test file after it is used.Neal Norwitz2004-02-291-0/+1
|
* Improvements to collections.deque():Raymond Hettinger2004-02-294-18/+229
| | | | | | | | * Add doctests for the examples in the library reference. * Add two methods, left() and right(), modeled after deques in C++ STL. * Apply the new method to asynchat.py. * Add comparison operators to make deques more substitutable for lists. * Replace the LookupErrors with IndexErrors to more closely match lists.
* - Allow easy opening of experimental database, if pimp >= 0.4Jack Jansen2004-02-281-9/+29
| | | | - Allow easy access to the PackMan homepage, for even more databases.
* getDefaultDatabase() should be a toplevel function, not a method of theJack Jansen2004-02-281-48/+46
| | | | preferences object.
* Started on version 0.4: better scheme for finding correct database:Jack Jansen2004-02-281-4/+50
| | | | | | | - Try not only "darwin-7.X.Y" but also "darwin-7.X" and "darwin-7", so far we've never had to create anew database for a minor release. - Distinguish between the various different installs (user-installed MacPython, apple-installed MacPython, other).
* Minor documentation changesVinay Sajip2004-02-283-9/+11
|
* Use versionadded for new featuresNeal Norwitz2004-02-281-0/+4
|
* Get rid of unused variableNeal Norwitz2004-02-281-1/+0
|
* Add version changed/added to docNeal Norwitz2004-02-281-0/+2
|
* Speed-up the joiner call by avoiding Py_BuildValue().Raymond Hettinger2004-02-271-1/+5
|
* made cPickle fall back to the copy_reg/reduce protocol,Christian Tismer2004-02-261-0/+5
| | | | | if a function cannot be stored as global. This is for compatibility with pickle.py .
* Ignore sizehint argument. Fixes SF #844561.Marc-André Lemburg2004-02-261-10/+4
|
* Oops, didn't mean to commit the removal of float_compare!Michael W. Hudson2004-02-261-1/+1
|
* Pass a variable that actually exists to PyFPE_END_PROTECT inMichael W. Hudson2004-02-261-2/+2
| | | | float_richcompare. Reported on c.l.py by Helmut Jarausch.
* Fixes SF bug # 778421Gregory P. Smith2004-02-264-6/+39
| | | | | | | | | * Fixed a bug in the compatibility interface set_location() method where it would not properly search to the next nearest key when used on BTree databases. [SF bug id 788421] * Fixed a bug in the compatibility interface set_location() method where it could crash when looking up keys in a hash or recno format database due to an incorrect free().
* Make _spawn_posix be ready for EINTR. waitpid(2) can be interruptedHye-Shik Chang2004-02-241-1/+8
| | | | | by SIGCHLD or sth because no signal is masked before. This fixes an optimized installation problem on FreeBSD libpthread.
* kLsUnknownType and kLSUnknownCreator were ints in stead of OSTypes.Jack Jansen2004-02-242-1/+5
| | | | Reported by Bob Ippolito.
* Setup file to allow the QuickTime for 2.4 to be compiledJack Jansen2004-02-242-0/+17
| | | | for MacPython 2.3 (and, hopefully, python 2.3 for windows too).