Mark Dickinson [Mon, 23 Mar 2009 18:25:13 +0000 (18:25 +0000)]
Issue #5512: speed up the long division algorithm for Python longs.
The basic algorithm remains the same; the most significant speedups
come from the following three changes:
(1) normalize by shifting instead of multiplying and dividing
(2) the old algorithm usually did an unnecessary extra iteration of
the outer loop; remove this. As a special case, this means that
long divisions with a single-digit result run twice as fast as
before.
(3) make inner loop much tighter.
Various benchmarks show speedups of between 50% and 150% for long
integer divisions and modulo operations.
Lars Gustäbel [Sun, 22 Mar 2009 20:09:33 +0000 (20:09 +0000)]
Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
forever on incomplete input. That caused tarfile.open() to hang when used
with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
partial bzip2 compressed data.
* Add clearer comment to initialization code.
* Add optional argument to popitem() -- modeled
after Anthon van der Neut's C version.
* Fix method markup in docs.
Improve implementation with better underlying data structure
for O(1) deletions. Big-Oh performance now the same as regular
dictionaries. Uses a doubly-linked list instead of a list/seq
to track insertion order.
Mark Dickinson [Wed, 18 Mar 2009 16:07:26 +0000 (16:07 +0000)]
Issue 4474: On platforms with sizeof(wchar_t) == 4 and
sizeof(Py_UNICODE) == 2, PyUnicode_FromWideChar now converts
each character outside the BMP to the appropriate surrogate pair.
Updated openssl support on VC6. (openssl-0.9.6g is old, cannot compile with _ssl.c)
If you use http://svn.python.org/projects/external/openssl-0.9.8g, Perl is not needed.
This scheme was ported from PCBuild.
Georg Brandl [Sun, 15 Mar 2009 21:43:38 +0000 (21:43 +0000)]
Fix a small nit in the error message if bool() falls back on __len__ and it returns the wrong type: it would tell the user that __nonzero__ should return bool or int.
Eric Smith [Sat, 14 Mar 2009 11:57:26 +0000 (11:57 +0000)]
Issue 5237, Allow auto-numbered replacement fields in str.format() strings.
For simple uses for str.format(), this makes the typing easier. Hopfully this
will help in the adoption of str.format().
For example:
'The {} is {}'.format('sky', 'blue')
You can mix and matcth auto-numbering and named replacement fields:
'The {} is {color}'.format('sky', color='blue')
But you can't mix and match auto-numbering and specified numbering:
'The {0} is {}'.format('sky', 'blue')
ValueError: cannot switch from manual field specification to automatic field numbering
Guilherme Polo [Sat, 7 Mar 2009 02:14:38 +0000 (02:14 +0000)]
Fixed issue #2638: Show a window constructed with tkSimpleDialog.Dialog only
after it is has been populated and properly configured in order to prevent
window flashing.
Guilherme Polo [Sat, 7 Mar 2009 01:47:49 +0000 (01:47 +0000)]
Fixed issue #4792: Prevent a segfault in _tkinter by using the
guaranteed to be safe interp argument given to the PythonCmd in place
of the Tcl interpreter taken from a PythonCmd_ClientData.
Ronald Oussoren [Wed, 4 Mar 2009 21:30:12 +0000 (21:30 +0000)]
Change framework search order when looking for Tcl/Tk on OSX.
This is needed because the system linker looks in /Library/Framework before
it looks in /System/Library frameworks. Without this patch _tkinter will
be unusable when it is compiled on a system that has Tk 8.5 installed in
/Library/Frameworks (and the Apple 8.4 install in /System/Library/Frameworks)
Brett Cannon [Wed, 4 Mar 2009 01:00:53 +0000 (01:00 +0000)]
Fix some more bugs caused by the backport from 3.x for importlib.
Do a more exact copy of the final 3.x code to resolve bugs and add
appropriate tests.