]> granicus.if.org Git - python/log
python
21 years agoconcrete example of why retaining old objects is good
Skip Montanaro [Sun, 21 Mar 2004 16:05:30 +0000 (16:05 +0000)]
concrete example of why retaining old objects is good

21 years agoPatch #853488: Tix hlist missing entryconfigure and entrycget methods.
Martin v. Löwis [Sun, 21 Mar 2004 15:29:41 +0000 (15:29 +0000)]
Patch #853488: Tix hlist missing entryconfigure and entrycget methods.

21 years agoPatch #853488: Add hlist entry_configure and entry_cget methods.
Martin v. Löwis [Sun, 21 Mar 2004 15:26:44 +0000 (15:26 +0000)]
Patch #853488: Add hlist entry_configure and entry_cget methods.

21 years agoRemove unused instance attributes.
Neil Schemenauer [Sun, 21 Mar 2004 15:18:50 +0000 (15:18 +0000)]
Remove unused instance attributes.

21 years agoImprove byte coding for multiple assignments.
Raymond Hettinger [Sun, 21 Mar 2004 15:12:00 +0000 (15:12 +0000)]
Improve byte coding for multiple assignments.
Gives 30% speedup on "a,b=1,2" and 25% on "a,b,c=1,2,3".

21 years agoRemoved extra period from \versionchanged entry; macro adds period
Brett Cannon [Sun, 21 Mar 2004 14:10:18 +0000 (14:10 +0000)]
Removed extra period from \versionchanged entry; macro adds period
automatically.

21 years agoBack out last patch that removed an entry from sys.path if it was not an
Brett Cannon [Sun, 21 Mar 2004 14:06:49 +0000 (14:06 +0000)]
Back out last patch that removed an entry from sys.path if it was not an
existent path.  Pointed out by jvr that entries could be non-file items for
custom importers.

21 years agoDeal with case of when locale time values has characters that can be mistaken
Brett Cannon [Sat, 20 Mar 2004 23:09:40 +0000 (23:09 +0000)]
Deal with case of when locale time values has characters that can be mistaken
for regex syntax.
Fixes bug #883604 .

21 years agoLimit the nesting depth of a tuple passed as the second argument to
Brett Cannon [Sat, 20 Mar 2004 22:52:14 +0000 (22:52 +0000)]
Limit the nesting depth of a tuple passed as the second argument to
isinstance() or issubclass() to the recursion limit of the interpreter.

21 years agoFix for SF 780407.
Guido van Rossum [Sat, 20 Mar 2004 22:34:14 +0000 (22:34 +0000)]
Fix for SF 780407.
Change %08l to %p to print a pointer.
Will backport to 2.3.

21 years agoGet rid of listextend_internal() and explain why the special case
Armin Rigo [Sat, 20 Mar 2004 22:19:23 +0000 (22:19 +0000)]
Get rid of listextend_internal() and explain why the special case
'a.extend(a)' isn't so special anyway.

21 years agoFix for SF 777848.
Guido van Rossum [Sat, 20 Mar 2004 22:18:03 +0000 (22:18 +0000)]
Fix for SF 777848.
I've been bitten by this myself in the past half year.
I hope this fix is right.
I'll backport this to 2.3.

21 years agoSF patch 508730 CGIHTTPServer execfile should save cwd
Tim Peters [Sat, 20 Mar 2004 21:51:12 +0000 (21:51 +0000)]
SF patch 508730  CGIHTTPServer execfile should save cwd

UNTESTED!!!

This simple two-line patch has been sitting on SF for more than 2 years.
I'm guessing it's because nobody knows how to test it -- I sure don't.
It doesn't look like you can get to this part of the code on Unixish
or Windows systems, so the "how to test it?" puzzle has more than one
part.  OTOH, if this is dead code, it doesn't matter either if I just
broke it <wink>.

21 years agoCancelled checkin, sorry.
Armin Rigo [Sat, 20 Mar 2004 21:50:13 +0000 (21:50 +0000)]
Cancelled checkin, sorry.

21 years agoClarify docs on where .pth files can exist.
Brett Cannon [Sat, 20 Mar 2004 21:41:28 +0000 (21:41 +0000)]
Clarify docs on where .pth files can exist.

21 years agomemset() hunt continuing. This is a net win.
Armin Rigo [Sat, 20 Mar 2004 21:35:09 +0000 (21:35 +0000)]
memset() hunt continuing.  This is a net win.

21 years agoRemove non-existent paths.
Brett Cannon [Sat, 20 Mar 2004 21:31:33 +0000 (21:31 +0000)]
Remove non-existent paths.

21 years agomemset() with small memory sizes just kill us.
Armin Rigo [Sat, 20 Mar 2004 21:10:27 +0000 (21:10 +0000)]
memset() with small memory sizes just kill us.

21 years agoFix how line endings were handled when iterating over a .pth file by stripping
Brett Cannon [Sat, 20 Mar 2004 21:08:17 +0000 (21:08 +0000)]
Fix how line endings were handled when iterating over a .pth file by stripping
all whitespace at the end of the path line.

21 years agoTweaked after following all these instructions.
Guido van Rossum [Sat, 20 Mar 2004 21:00:26 +0000 (21:00 +0000)]
Tweaked after following all these instructions.

Removed Win9x notes (since the .NET compiler requires Win2K or XP anyway).

21 years agotest_email: comment out two fail-test cases that no longer fail with the new
Thomas Wouters [Sat, 20 Mar 2004 20:29:50 +0000 (20:29 +0000)]
test_email: comment out two fail-test cases that no longer fail with the new
parser -- for now. Failure behaviour of the new parser(s) will change in any
case, so this will be revisited later anyway.

21 years agoSpeed HMAC.copy() by installing a secret backdoor argument to
Tim Peters [Sat, 20 Mar 2004 20:11:29 +0000 (20:11 +0000)]
Speed HMAC.copy() by installing a secret backdoor argument to
HMAC.__init__().  Adapted from SF patch 895445 "hmac.HMAC.copy() speedup"
by Trevor Perrin, who reported that this approach increased throughput
of his hmac-intensive app by 30%.

21 years agoA 2% speed improvement with gcc on low-endian machines. My guess is that this
Armin Rigo [Sat, 20 Mar 2004 20:03:17 +0000 (20:03 +0000)]
A 2% speed improvement with gcc on low-endian machines.  My guess is that this
new pattern for NEXTARG() is detected and optimized as a single (*short)
loading.

21 years agoGCC was complaining that 'value' in dictiter_iternextvalue() wasn't
Guido van Rossum [Sat, 20 Mar 2004 19:11:58 +0000 (19:11 +0000)]
GCC was complaining that 'value' in dictiter_iternextvalue() wasn't
necessarily always set before used.  Between Tim, Armin & me we
couldn't prove GCC wrong, so we decided to fix the algorithm.  This
version is Armin's.

21 years agoSF bug #918371: hasattr()'s return type
Raymond Hettinger [Sat, 20 Mar 2004 18:25:31 +0000 (18:25 +0000)]
SF bug #918371: hasattr()'s return type

Replace 1 and 0 with True and False.

21 years agoMerge in Anthony's new parser code, from the anthony-parser-branch:
Thomas Wouters [Sat, 20 Mar 2004 17:31:29 +0000 (17:31 +0000)]
Merge in Anthony's new parser code, from the anthony-parser-branch:

> ----------------------------
> revision 1.20.4.4
> date: 2003/06/12 09:14:17;  author: anthonybaxter;  state: Exp;  lines: +13 -6
> preamble is None when missing, not ''.
> Handle a couple of bogus formatted messages - now parses my main testsuite.
> Handle message/external-body.
> ----------------------------
> revision 1.20.4.3
> date: 2003/06/12 07:16:40;  author: anthonybaxter;  state: Exp;  lines: +6 -4
> epilogue-processing is now the same as the old parser - the newline at the
> end of the line with the --endboundary-- is included as part of the epilogue.
> Note that any whitespace after the boundary is _not_ part of the epilogue.
> ----------------------------
> revision 1.20.4.2
> date: 2003/06/12 06:39:09;  author: anthonybaxter;  state: Exp;  lines: +6 -4
> message/delivery-status fixed.
> HeaderParser fixed.
> ----------------------------
> revision 1.20.4.1
> date: 2003/06/12 06:08:56;  author: anthonybaxter;  state: Exp;  lines: +163 -129
> A work-in-progress snapshot of the new parser. A couple of known problems:
>
> - first (blank) line of MIME epilogues is being consumed
> - message/delivery-status isn't quite right
>
> It still needs a lot of cleanup, but right now it parses a whole lot of
> badness that the old parser failed on. I also need to think about adding
> back the old 'strict' flag in some way.
> =============================================================================

21 years agoUpdate copyright years, and change copyright.tex to use the same spelling
Tim Peters [Sat, 20 Mar 2004 17:24:51 +0000 (17:24 +0000)]
Update copyright years, and change copyright.tex to use the same spelling
as license.tex (SF patch 795531 complained about the spelling discrepancy,
although this "repairs" that flaw in a different way than the patch).

21 years agocommit the portion of PyXML patch #919008 that is relevant to the
Fred Drake [Sat, 20 Mar 2004 08:15:30 +0000 (08:15 +0000)]
commit the portion of PyXML patch #919008 that is relevant to the
standard library:
str() of xml.sax.SAXParseException should not fail if the line and/or
column number returned by the locator are None
(tests added)

21 years agofix two typos that turned text into markup
Fred Drake [Sat, 20 Mar 2004 08:13:32 +0000 (08:13 +0000)]
fix two typos that turned text into markup

21 years agoIgnore oodles of MSVC-generated files.
Tim Peters [Sat, 20 Mar 2004 05:00:56 +0000 (05:00 +0000)]
Ignore oodles of MSVC-generated files.

21 years agoA helper for rt.bat, copied (but with path adjustment) from PCbuild.
Tim Peters [Sat, 20 Mar 2004 04:57:32 +0000 (04:57 +0000)]
A helper for rt.bat, copied (but with path adjustment) from PCbuild.

21 years agoPyFile_WriteObject(): some of the local variables are only used when
Fred Drake [Fri, 19 Mar 2004 15:22:36 +0000 (15:22 +0000)]
PyFile_WriteObject():  some of the local variables are only used when
                       Py_USING_UNICODE is defined

21 years agoExpand on the semantics of reload(). Closes #919099.
Skip Montanaro [Fri, 19 Mar 2004 15:20:16 +0000 (15:20 +0000)]
Expand on the semantics of reload().  Closes #919099.

21 years agoFactor out a double lookup.
Raymond Hettinger [Fri, 19 Mar 2004 10:30:00 +0000 (10:30 +0000)]
Factor out a double lookup.

21 years agoAdd an entry for addition of the ptcp154 codec.
Hye-Shik Chang [Fri, 19 Mar 2004 08:11:56 +0000 (08:11 +0000)]
Add an entry for addition of the ptcp154 codec.

21 years agoAdd a new unicode codec: ptcp154 (Kazakh)
Hye-Shik Chang [Fri, 19 Mar 2004 08:06:07 +0000 (08:06 +0000)]
Add a new unicode codec: ptcp154 (Kazakh)

21 years agoMake iterators length transparent where possible.
Raymond Hettinger [Thu, 18 Mar 2004 22:43:10 +0000 (22:43 +0000)]
Make iterators length transparent where possible.

21 years agoImprove deque iteration.
Raymond Hettinger [Thu, 18 Mar 2004 11:04:57 +0000 (11:04 +0000)]
Improve deque iteration.
* The default __reversed__ performed badly, so reintroduced a custom
  reverse iterator.
* Added length transparency to improve speed with map(), list(), etc.

21 years agoAdd news entries for the dictionary optimizations.
Raymond Hettinger [Thu, 18 Mar 2004 09:48:12 +0000 (09:48 +0000)]
Add news entries for the dictionary optimizations.

21 years agoMake the new dictionary iterators transparent with respect to length.
Raymond Hettinger [Thu, 18 Mar 2004 08:38:00 +0000 (08:38 +0000)]
Make the new dictionary iterators transparent with respect to length.
This gives another 30% speedup for operations such as
map(func, d.iteritems()) or list(d.iteritems()) which can both take
advantage of length information when provided.

21 years agoIgnore error status codes occurred while compiling site-packages
Hye-Shik Chang [Thu, 18 Mar 2004 07:51:27 +0000 (07:51 +0000)]
Ignore error status codes occurred while compiling site-packages
directory.

21 years agoFix capitalization of title for subsection 2.
Brett Cannon [Thu, 18 Mar 2004 07:37:15 +0000 (07:37 +0000)]
Fix capitalization of title for subsection 2.

21 years agoOptimize dictionary iterators.
Raymond Hettinger [Thu, 18 Mar 2004 02:41:19 +0000 (02:41 +0000)]
Optimize dictionary iterators.

* Split into three separate types that share everything except the
  code for iternext.  Saves run time decision making and allows
  each iternext function to be specialized.

* Inlined PyDict_Next().  In addition to saving a function call, this
  allows a redundant test to be eliminated and further specialization
  of the code for the unique needs of each iterator type.

* Created a reusable result tuple for iteritems().  Saves the malloc
  time for tuples when the previous result was not kept by client code
  (this is the typical use case for iteritems).  If the client code
  does keep the reference, then a new tuple is created.

Results in a 20% to 30% speedup depending on the size and sparsity
of the dictionary.

21 years agoMinor grammatical fixes.
Brett Cannon [Thu, 18 Mar 2004 01:38:11 +0000 (01:38 +0000)]
Minor grammatical fixes.

21 years agoExtremely minor typo fixed.
Brett Cannon [Thu, 18 Mar 2004 00:49:01 +0000 (00:49 +0000)]
Extremely minor typo fixed.

21 years agoDictionary optimizations:
Raymond Hettinger [Wed, 17 Mar 2004 21:55:03 +0000 (21:55 +0000)]
Dictionary optimizations:

* Factored constant structure references out of the inner loops for
  PyDict_Next(), dict_keys(), dict_values(), and dict_items().
  Gave measurable speedups to each (the improvement varies depending
  on the sparseness of the dictionary being measured).

* Added a freelist scheme styled after that for tuples.  Saves around
  80% of the calls to malloc and free.  About 10% of the time, the
  previous dictionary was completely empty; in those cases, the
  dictionary initialization with memset() can be skipped.

21 years agoAdd missing decref
Raymond Hettinger [Wed, 17 Mar 2004 05:24:23 +0000 (05:24 +0000)]
Add missing decref

21 years agoSpeedup the inner loops for dropwhile(), islice(), ifilter(), and
Raymond Hettinger [Wed, 17 Mar 2004 04:27:44 +0000 (04:27 +0000)]
Speedup the inner loops for dropwhile(), islice(), ifilter(), and
ifilterfalse().

21 years agoThe example files need to be opened with the "b" flag.
Skip Montanaro [Wed, 17 Mar 2004 01:24:17 +0000 (01:24 +0000)]
The example files need to be opened with the "b" flag.

21 years ago* supply a more useful error message when append() is called on the
Gregory P. Smith [Tue, 16 Mar 2004 18:50:26 +0000 (18:50 +0000)]
* supply a more useful error message when append() is called on the
  wrong type of database in dbshelve.
* fix a typo in the exception name when checking args

21 years agobugfix for people executing test_all to run the test suite. (call the
Gregory P. Smith [Tue, 16 Mar 2004 07:07:06 +0000 (07:07 +0000)]
bugfix for people executing test_all to run the test suite.  (call the
correct function)

21 years agofixes SF bug 914019 - DB.has_key was not honoring its txn argument
Gregory P. Smith [Tue, 16 Mar 2004 06:56:58 +0000 (06:56 +0000)]
fixes SF bug 914019 - DB.has_key was not honoring its txn argument

21 years ago1. Make builtin foreground Royal Purple instead of Barney Purple.
Kurt B. Kaiser [Tue, 16 Mar 2004 03:36:41 +0000 (03:36 +0000)]
1. Make builtin foreground Royal Purple instead of Barney Purple.
2. Touch up help.txt

M config-highlight.def
M help.txt

21 years agoFix typos and add some elaborations
Raymond Hettinger [Mon, 15 Mar 2004 15:52:22 +0000 (15:52 +0000)]
Fix typos and add some elaborations

21 years agoPort test_binascii.py to PyUnit and enhance tests.
Walter Dörwald [Mon, 15 Mar 2004 12:07:38 +0000 (12:07 +0000)]
Port test_binascii.py to PyUnit and enhance tests.
Code coverage for binascii.c is at 92%.
From SF patch #736962.

21 years agoRevert last change. Found an application that was worse off with resize
Raymond Hettinger [Mon, 15 Mar 2004 09:01:31 +0000 (09:01 +0000)]
Revert last change.  Found an application that was worse off with resize
exact turned on.  The tiny space savings wasn't worth the additional time
and code.

21 years ago1. Bug in Patch 805830 fixed by Nigel Rowe
Kurt B. Kaiser [Mon, 15 Mar 2004 04:26:37 +0000 (04:26 +0000)]
1. Bug in Patch 805830 fixed by Nigel Rowe
2. Convert 1/0 to True/False
3. Fix a couple of long lines

M ColorDelegator.py
M NEWS.txt

21 years agoEliminate an unnecessary test on a common code path.
Raymond Hettinger [Mon, 15 Mar 2004 00:16:34 +0000 (00:16 +0000)]
Eliminate an unnecessary test on a common code path.

21 years agoAdd missing docstrings.
Raymond Hettinger [Sun, 14 Mar 2004 07:54:37 +0000 (07:54 +0000)]
Add missing docstrings.

21 years agolist_resize() now has an "exact" option for bypassing the overallocation
Raymond Hettinger [Sun, 14 Mar 2004 06:42:23 +0000 (06:42 +0000)]
list_resize() now has an "exact" option for bypassing the overallocation
scheme in situations that likely won't benefit from it.  This further
improves memory utilization from Py2.3 which always over-allocates
except for PyList_New().

Situations expected to benefit from over-allocation:
    list.insert(), list.pop(), list.append(), and list.extend()

Situations deemed unlikely to benefit:
    list_inplace_repeat, list_ass_slice, list_ass_subscript

The most gray area was for listextend_internal() which only runs
when the argument is a list or a tuple.  This could be viewed as
a one-time fixed length addition or it could be viewed as wrapping
a series of appends.  I left its over-allocation turned on but
could be convinced otherwise.

21 years agoSF feature request #686323: Minor array module enhancements
Raymond Hettinger [Sun, 14 Mar 2004 05:43:59 +0000 (05:43 +0000)]
SF feature request #686323:  Minor array module enhancements

array.extend() now accepts iterable arguments implements as a series
of appends.  Besides being a user convenience and matching the behavior
for lists, this the saves memory and cycles that would be used to
create a temporary array object.

21 years agoUpdate the array overallocation scheme to match the approach used for
Raymond Hettinger [Sun, 14 Mar 2004 04:37:50 +0000 (04:37 +0000)]
Update the array overallocation scheme to match the approach used for
lists.  Speeds append() operations and reduces memory requirements
(because of more conservative overallocation).

Paves the way for the feature request for array.extend() to support
arbitrary iterable arguments.

21 years agoTwo issues spotted by Ronald OUssoren:
Jack Jansen [Sat, 13 Mar 2004 23:50:48 +0000 (23:50 +0000)]
Two issues spotted by Ronald OUssoren:
- there were no accessor functions for the global per-database fields
- packages and their dependencies were installed in order in stead
  of in reverse order.

21 years agoDon't use "dict" as a variable, it shadows the builtin. Spotted by
Jack Jansen [Sat, 13 Mar 2004 23:32:47 +0000 (23:32 +0000)]
Don't use "dict" as a variable, it shadows the builtin. Spotted by
Bob Ippolito.

21 years agocompile.h and eval.h weren't being included which kept a fair bit of the
Skip Montanaro [Sat, 13 Mar 2004 23:11:44 +0000 (23:11 +0000)]
compile.h and eval.h weren't being included which kept a fair bit of the
public API from being exposed by simply including Python.h (as recommended).

21 years agoForce option should be applied to a single package, not recursively
Jack Jansen [Sat, 13 Mar 2004 23:03:38 +0000 (23:03 +0000)]
Force option should be applied to a single package, not recursively
to its dependencies. Fixes #733819.

21 years agoSF patch #906501: Fix typos in pystate.h comments
Raymond Hettinger [Sat, 13 Mar 2004 20:45:47 +0000 (20:45 +0000)]
SF patch #906501:  Fix typos in pystate.h comments
(Contributed by Greg Chapman.)

21 years agoSF patch #911431: robot.txt must be robots.txt
Raymond Hettinger [Sat, 13 Mar 2004 20:27:23 +0000 (20:27 +0000)]
SF patch #911431: robot.txt must be robots.txt
(Contributed by George Yoshida.)

21 years agoSF bug #910986: copy.copy fails for array.array
Raymond Hettinger [Sat, 13 Mar 2004 18:18:51 +0000 (18:18 +0000)]
SF bug #910986:  copy.copy fails for array.array

Added support for the copy module.

21 years agoMake PySequence_Fast_ITEMS public. (Thanks Skip.)
Raymond Hettinger [Fri, 12 Mar 2004 16:38:17 +0000 (16:38 +0000)]
Make PySequence_Fast_ITEMS public.  (Thanks Skip.)

21 years agoLIST_APPEND is predicably followed by JUMP_ABSOLUTE.
Raymond Hettinger [Fri, 12 Mar 2004 16:33:17 +0000 (16:33 +0000)]
LIST_APPEND is predicably followed by JUMP_ABSOLUTE.
Reduces loop overhead by an additional 10%.

21 years ago* Eliminate duplicate call to PyObject_Size().
Raymond Hettinger [Fri, 12 Mar 2004 15:30:38 +0000 (15:30 +0000)]
* Eliminate duplicate call to PyObject_Size().
  (Spotted by Michael Hudson.)

* Now that "selflen" is no longer inside a loop, it should not be a
  register variable.

21 years agoMove the code for BREAK and CONTINUE_LOOP to be near FOR_ITER.
Raymond Hettinger [Fri, 12 Mar 2004 09:12:22 +0000 (09:12 +0000)]
Move the code for BREAK and CONTINUE_LOOP to be near FOR_ITER.
Makes it more likely that all loop operations are in the cache
at the same time.

21 years agoSpeedup for-loops by inlining PyIter_Next(). Saves duplicate tests
Raymond Hettinger [Fri, 12 Mar 2004 08:41:36 +0000 (08:41 +0000)]
Speedup for-loops by inlining PyIter_Next().  Saves duplicate tests
and a function call resulting in a 15% reduction of total loop overhead
(as measured by timeit.Timer('pass')).

21 years agoUse a new macro, PySequence_Fast_ITEMS to factor out code common to
Raymond Hettinger [Fri, 12 Mar 2004 08:04:00 +0000 (08:04 +0000)]
Use a new macro, PySequence_Fast_ITEMS to factor out code common to
three recent optimizations.  Aside from reducing code volume, it
increases readability.

21 years ago- Added a downloader using urllib2 in stead of curl, based on code
Jack Jansen [Thu, 11 Mar 2004 23:03:59 +0000 (23:03 +0000)]
- Added a downloader using urllib2 in stead of curl, based on code
donated by Kevin Ollivier. This is now the default downloader.
- Added a watcher mechanism, whereby downloaders and unpackers (and,
later builders) can give status feedback to the user. When running
pimp as a command line tool in verbose mode print this output.

21 years agoNow that list.extend() is at the root of many list operations, it becomes
Raymond Hettinger [Thu, 11 Mar 2004 09:48:18 +0000 (09:48 +0000)]
Now that list.extend() is at the root of many list operations, it becomes
worth it to in-line the call to PyIter_Next().

Saves another 15% on most list operations that acceptable a general
iterable argument (such as the list constructor).

21 years agoEliminate a big block of duplicate code in PySequence_List() by
Raymond Hettinger [Thu, 11 Mar 2004 09:13:12 +0000 (09:13 +0000)]
Eliminate a big block of duplicate code in PySequence_List() by
exposing _PyList_Extend().

21 years agolist_inplace_concat() is now expressed in terms of list_extend() which
Raymond Hettinger [Thu, 11 Mar 2004 07:34:19 +0000 (07:34 +0000)]
list_inplace_concat() is now expressed in terms of list_extend() which
avoids creating an intermediate tuple for iterable arguments other than
lists or tuples.

In other words, a+=b no longer requires extra memory when b is not a
list or tuple.  The list and tuple cases are unchanged.

21 years agoMake buffer objects based on mutable objects (like array) safe.
Neil Schemenauer [Thu, 11 Mar 2004 02:42:45 +0000 (02:42 +0000)]
Make buffer objects based on mutable objects (like array) safe.

21 years agoDocument one of the many problems with the buffer object.
Neil Schemenauer [Thu, 11 Mar 2004 01:00:44 +0000 (01:00 +0000)]
Document one of the many problems with the buffer object.

21 years agoRename static functions, they should not have the _Py prefix.
Neil Schemenauer [Thu, 11 Mar 2004 00:44:54 +0000 (00:44 +0000)]
Rename static functions, they should not have the _Py prefix.

21 years agoMake test_coercion.py less sensitive to platform fp quirks. Closes
Neil Schemenauer [Wed, 10 Mar 2004 17:30:03 +0000 (17:30 +0000)]
Make test_coercion.py less sensitive to platform fp quirks.  Closes
SF bug #678265.

21 years agoUse memcpy() instead of memmove() when the buffers are known to be distinct.
Raymond Hettinger [Wed, 10 Mar 2004 11:44:04 +0000 (11:44 +0000)]
Use memcpy() instead of memmove() when the buffers are known to be distinct.

21 years agoTidied up the implementations of reversed (including the custom ones
Raymond Hettinger [Wed, 10 Mar 2004 10:10:42 +0000 (10:10 +0000)]
Tidied up the implementations of reversed (including the custom ones
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.

21 years agoEliminate the double reverse option. It's only use case
Raymond Hettinger [Wed, 10 Mar 2004 08:32:47 +0000 (08:32 +0000)]
Eliminate the double reverse option.  It's only use case
was academic and it was potentially confusing to use.

21 years agoOptimize inner loops for subscript, repeat, and concat.
Raymond Hettinger [Tue, 9 Mar 2004 13:05:22 +0000 (13:05 +0000)]
Optimize inner loops for subscript, repeat, and concat.

21 years agoOptimize slice assignments.
Raymond Hettinger [Tue, 9 Mar 2004 08:04:33 +0000 (08:04 +0000)]
Optimize slice assignments.

* 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.

21 years agoSF Patch #912462: Relocate \end tag to the right place.
Hye-Shik Chang [Tue, 9 Mar 2004 05:53:15 +0000 (05:53 +0000)]
SF Patch #912462: Relocate \end tag to the right place.
(Submitted by George Yoshida)

21 years agoRefactor and optimize code for UNPACK_SEQUENCE.
Raymond Hettinger [Mon, 8 Mar 2004 23:25:30 +0000 (23:25 +0000)]
Refactor and optimize code for UNPACK_SEQUENCE.

* 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.

21 years agoRemove calls to currentThread() in _Condition methods that were side-effect.
Brett Cannon [Mon, 8 Mar 2004 22:18:57 +0000 (22:18 +0000)]
Remove calls to currentThread() in _Condition methods that were side-effect.
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 .

21 years agoThe copy module now handles sets directly. The __copy__ methods are no
Raymond Hettinger [Mon, 8 Mar 2004 18:31:10 +0000 (18:31 +0000)]
The copy module now handles sets directly.  The __copy__ methods are no
longer needed.

21 years agoSF patch #907403: Improvements to cStringIO.writelines()
Raymond Hettinger [Mon, 8 Mar 2004 18:22:35 +0000 (18:22 +0000)]
SF patch #907403:  Improvements to cStringIO.writelines()

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.

21 years agoSF patch #907403: Improvements to cStringIO.writelines()
Raymond Hettinger [Mon, 8 Mar 2004 18:17:31 +0000 (18:17 +0000)]
SF patch #907403:  Improvements to cStringIO.writelines()

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.

21 years agoAdd a highlight theme for builtin keywords. Python Patch 805830 Nigel Rowe
Kurt B. Kaiser [Mon, 8 Mar 2004 18:15:31 +0000 (18:15 +0000)]
Add a highlight theme for builtin keywords.  Python Patch 805830 Nigel Rowe

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

21 years agoRemoved spurious import statement
Vinay Sajip [Mon, 8 Mar 2004 16:57:19 +0000 (16:57 +0000)]
Removed spurious import statement

21 years agoOptimize tuple_slice() and make further improvements to list_slice()
Raymond Hettinger [Mon, 8 Mar 2004 07:25:05 +0000 (07:25 +0000)]
Optimize tuple_slice() and make further improvements to list_slice()
and list.extend().  Factoring the inner loops to remove the constant
structure references and fixed offsets gives speedups ranging from
20% to 30%.

21 years agoRefactor the copy dispatcher code in copy.py. Simplifies and shortens
Raymond Hettinger [Mon, 8 Mar 2004 05:59:33 +0000 (05:59 +0000)]
Refactor the copy dispatcher code in copy.py.  Simplifies and shortens
the code by grouping common cases together.

21 years agoSmall optimizations for list_slice() and list_extend_internal().
Raymond Hettinger [Mon, 8 Mar 2004 05:56:15 +0000 (05:56 +0000)]
Small optimizations for list_slice() and list_extend_internal().

* 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.

21 years agoFactor out code common to PyDict_Copy() and PyDict_Merge().
Raymond Hettinger [Mon, 8 Mar 2004 04:19:01 +0000 (04:19 +0000)]
Factor out code common to PyDict_Copy() and PyDict_Merge().