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')).
Use a new macro, PySequence_Fast_ITEMS to factor out code common to
three recent optimizations. Aside from reducing code volume, it
increases readability.
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.
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.
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.
* 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.
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.
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.
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.
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
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%.
Brett Cannon [Sun, 7 Mar 2004 23:16:27 +0000 (23:16 +0000)]
Deal with possible case of having time.tzname[1] containing UTC or GMT.
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 .
Hye-Shik Chang [Thu, 4 Mar 2004 06:35:57 +0000 (06:35 +0000)]
SF Patch #902444: Use process scope thread on FreeBSD. System scope
is too expensive on FreeBSD's KSE threading infrastructure and
even test_threadedimport fails on default setting.
Brett Cannon [Tue, 2 Mar 2004 04:38:10 +0000 (04:38 +0000)]
Have strftime() check its time tuple argument to make sure the tuple's values
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).
Skip Montanaro [Mon, 1 Mar 2004 15:44:05 +0000 (15:44 +0000)]
Add pystack definition to Misc/gdbinit with some explanation of its behavior
and add flag comments to ceval.c and main.c alerting people to the coupling
between pystack and the layout of those files.
* 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.
Jack Jansen [Sat, 28 Feb 2004 22:34:02 +0000 (22:34 +0000)]
Started on version 0.4: better scheme for finding correct database:
- 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).
Gregory P. Smith [Thu, 26 Feb 2004 10:07:14 +0000 (10:07 +0000)]
Fixes SF bug # 778421
* 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().
Hye-Shik Chang [Tue, 24 Feb 2004 23:54:17 +0000 (23:54 +0000)]
Make _spawn_posix be ready for EINTR. waitpid(2) can be interrupted
by SIGCHLD or sth because no signal is masked before. This fixes
an optimized installation problem on FreeBSD libpthread.
Jeremy Hylton [Tue, 24 Feb 2004 19:40:35 +0000 (19:40 +0000)]
Fix two bugs in the new do_open() implementation for HTTPHandler.
Invoke the standard error handlers for non-200 responses.
Always supply a "Connection: close" header to prevent the server from
leaving the connection open. Downstream users of the socket may
attempt recv()/read() with no arguments, which would block if the
connection were kept open.
Thomas Heller [Fri, 20 Feb 2004 18:33:38 +0000 (18:33 +0000)]
wininst-6.exe and wininst-7.1.exe are in CVS, so that they can be
included in Python distributions for systems other than Windows.
Windows installers can be build on non-Windows systems as long as they
only include pure python module distributions.
Thomas Heller [Fri, 20 Feb 2004 18:05:13 +0000 (18:05 +0000)]
To avoid problems with conflicting dlls, the windows installers built
by bdist_wininst *must* use the same runtime libary as the Python
version.
Actually this means the Python version where the installer is run, not
the one which is used to build it. Must think about that - for now I
assume MSVC6 is used up to Python 2.3, and MSVC7.1 is used starting at
Python 2.4.
So the filename for wininst.exe is now wininst-6.exe for the Release
version and wininst-6_d.exe for the Debug version, when built with
MSVC6.
Thomas Heller [Fri, 20 Feb 2004 14:44:32 +0000 (14:44 +0000)]
Recompiled the binary wininst.exe.
Patch #892660 from Mark Hammond, for distutils bdist_wininst command.
install.c: support for a 'pre-install-script', run before anything has
been installed. Provides a 'message_box' module function for use by
either the pre-install or post-install scripts.
bdist_wininst.py: support for pre-install script. Typo (build->built),
fixes so that --target-version can still work, even when the
distribution has extension modules - in this case, we insist on
--skip-build, as we still can't actually build other versions.
Thomas Heller [Fri, 20 Feb 2004 14:43:21 +0000 (14:43 +0000)]
Patch #892660 from Mark Hammond, for distutils bdist_wininst command.
install.c: support for a 'pre-install-script', run before anything has
been installed. Provides a 'message_box' module function for use by
either the pre-install or post-install scripts.
bdist_wininst.py: support for pre-install script. Typo (build->built),
fixes so that --target-version can still work, even when the
distribution has extension modules - in this case, we insist on
--skip-build, as we still can't actually build other versions.
Vinay Sajip [Fri, 20 Feb 2004 13:18:36 +0000 (13:18 +0000)]
Copyright year & version number/version date changes.
Exception traceback text is now cached.
Closing a handler now removes it from the internal _handlers list.
Handlers now chain to Handler.close() from their close() methods.
Exception info can be passed as a tuple in exc_info.
shutdown() is registered to be called at application exit.
Vinay Sajip [Fri, 20 Feb 2004 13:17:27 +0000 (13:17 +0000)]
Copyright year change.
Corrections to comments.
Tracebacks can now be sent via SocketHandler.
SocketHandler now uses exponential backoff strategy.
Handlers now chain to Handler.close() from their close() methods.
Fred Drake [Thu, 19 Feb 2004 23:17:46 +0000 (23:17 +0000)]
- "Mac OS" should always include the space
- comment out documentation for a non-existant feature (--spec-file)
that the comments indicate isn't clearly needed
- lots of minor markup adjustments to get a more consistent
presentation
Fred Drake [Thu, 19 Feb 2004 23:03:29 +0000 (23:03 +0000)]
- according to Apple's publication style guide, yes, "Mac people" use
the term Installer (always capitalized, however)
- generalize the text about the term "installer" in a fairly
reasonable way
Fred Drake [Thu, 19 Feb 2004 22:28:15 +0000 (22:28 +0000)]
use API documentation style for the descriptions of the additional
functions made available in the post-installation script run by the
Windows installer
Guido van Rossum [Thu, 19 Feb 2004 19:16:50 +0000 (19:16 +0000)]
Fix two small bugs: (1) on Windows, pathname munging didn't work
right; (2) write_results_file() didn't return a tuple of two ints when
it couldn't create the file. Will backport.
Keep the list.pop() optimization while restoring the many possibility
for types other than PyInt being accepted for the optional argument.
(Spotted by Neal Norwitz.)
David Ascher [Wed, 18 Feb 2004 05:59:53 +0000 (05:59 +0000)]
Implementation of patch 869468
Allow the user to create Tkinter.Tcl objects which are
just like Tkinter.Tk objects except that they do not
initialize Tk. This is useful in circumstances where the
script is being run on machines that do not have an X
server running -- in those cases, Tk initialization fails,
even if no window is ever created.
Fred Drake [Tue, 17 Feb 2004 22:35:19 +0000 (22:35 +0000)]
commentary about how bad ConfigParser is doesn't help here, and the
suggested approach to dealing with it isn't a good one; we need a
better general purpose config reader, not a distutils-specific reader