As discussed on python-dev, removed from DUP_TOPX support for the
parameter being either four or five. Currently, compile.c does not
generate calls with a parameter higher than three.
May have to be reverted if the second alpha or beta shakes out some
other tool generating this op code with a parameter of four or five.
Neal Norwitz [Fri, 10 Jan 2003 15:31:15 +0000 (15:31 +0000)]
As discussed briefly on python-dev, add Pending Deprecation Warning
when a string exception is raised. Note that raising string exceptions
is deprecated in an exception message.
Kurt B. Kaiser [Fri, 10 Jan 2003 05:07:24 +0000 (05:07 +0000)]
1. Make finding Python help docs more robust, including the installed
configuation.
2. Make sure that os.startfile() is used to open both Python help docs
and Extra Help docs on the Windows platforms.
Tim Peters [Fri, 10 Jan 2003 03:49:02 +0000 (03:49 +0000)]
Got rid of the timetz type entirely. This was a bit trickier than I
hoped it would be, but not too bad. A test had to change:
time.__setstate__() can no longer add a non-None tzinfo member to a time
object that didn't already have one, since storage for a tzinfo member
doesn't exist in that case.
SF patch #664320: Replace push/pop clusters in ceval.c
Replaced groups of pushes and pops with indexed access to the stack and
a single adjustment (if needed) to the stacklevel.
Avoids scores of unnecessary increments and decrements to the stackpointer.
Removes unnecessary sequential dependencies so that the compiler has more
freedom for optimizations. Frees the processor for more parallel and
pipelined execution by using mostly read-only access and having few pointer
adjustments just prior to a read or write.
Walter Dörwald [Wed, 8 Jan 2003 23:22:13 +0000 (23:22 +0000)]
Add a few test cases to increase code coverage:
From:
69.73% of 294 source lines executed in file ./Modules/_codecsmodule.c
79.47% of 487 source lines executed in file Python/codecs.c
78.45% of 3643 source lines executed in file Objects/unicodeobject.c
To:
70.41% of 294 source lines executed in file ./Modules/_codecsmodule.c
82.75% of 487 source lines executed in file Python/codecs.c
80.76% of 3638 source lines executed in file Objects/unicodeobject.c
This actually unearthed a bug in the handling of None
values in PyUnicode_EncodeCharmap.
Walter Dörwald [Wed, 8 Jan 2003 22:01:33 +0000 (22:01 +0000)]
Fix charmapencode_lookup(), so that a None value in the mapping
is treated as "character maps to <undefined>" and not as
"character mapping must return integer, None or str".
Tim Peters [Wed, 8 Jan 2003 20:40:01 +0000 (20:40 +0000)]
Utterly minimal changes to collapse datetimetz into datetime, and timetz
into time. This is little more than *exporting* the datetimetz object
under the name "datetime", and similarly for timetz. A good implementation
of this change requires more work, but this is fully functional if you
don't stare too hard at the internals (e.g., right now a type named
"datetime" shows up as a base class of the type named "datetime"). The
docs also need extensive revision, not part of this checkin.
Jack Jansen [Wed, 8 Jan 2003 16:33:40 +0000 (16:33 +0000)]
Always define getenv(), as suggested by Guido. This means that os.getenv() is also defined for MacPython-OS9 (even though it doesn't actually do anything useful), and it shouldn't hurt on other platforms.
Jack Jansen [Wed, 8 Jan 2003 16:32:29 +0000 (16:32 +0000)]
Removed the SetDates warning. The warning is in the readme, and the print statement was too obtrusive (it appeared during the installation process, and the user needed to close the resulting window manually).
Jack Jansen [Wed, 8 Jan 2003 16:29:17 +0000 (16:29 +0000)]
Made "ascii" the default encoding for MacPython, as suggested by MvL, and ripped out my previous changes to test_unicode. Doing this for 2.3a1 should give people enough time to complain, if they want to, and then we can see whether we want to do anything about it.
Fred Drake [Wed, 8 Jan 2003 07:09:43 +0000 (07:09 +0000)]
- be explicit: audio data files should be opened in binary mode
- ossaudiodev.open() raises IOError, not ossaudiodev.error, for cases
which get mapped to TestSkipped
Fix for SF bug #642358: only provide a new with a __dict__ or
__weaklist__ descriptor if we added __dict__ or __weaklist__,
respectively. With unit test.
Add a test for a feature added in rev. 2.82 of typeobject.c:
- SLOT1BINFULL() macro: changed this to check for __rop__ overriding
__op__, like binary_op1() in abstract.c -- the latter only calls the
slot function once if both types use the same slot function, so the
slot function must make both calls -- which it already did for the
__op__, __rop__ order, but not yet for the __rop__, __op__ order
when B.__class__ is a subclass of A.__class__.
Also test the refinement added in rev. 2.201 that fixes the problem
reported in SF bug #623669.
Also test a similar provision in abstract.c's binary_op1().
Add a refinement to SLOT1BINFULL() that fixes the problem reported in
SF bug #623669: only try (e.g.) __rdiv__ before __div__ if the right
class actually overrides it.
GvR's idea to use memset() for the most common special case of repeating
a single character. Shaves another 10% off the running time by avoiding
the lg2(N) loops and cache effects for the other cases.
Fred Drake [Mon, 6 Jan 2003 15:50:32 +0000 (15:50 +0000)]
Fix some nits Guido brought up last August:
- give subsection pages nicer names
- shorten some really long table cells; table cells can't wrap in the
typeset version of the documentation
Jason Tishler [Mon, 6 Jan 2003 12:41:26 +0000 (12:41 +0000)]
Patch #661760: Cygwin auto-import module patch
The attached patch enables shared extension
modules to build cleanly under Cygwin without
moving the static initialization of certain function
pointers (i.e., ones exported from the Python
DLL core) to a module initialization function.
Additionally, this patch fixes the modules that
have been changed in the past to accommodate
Cygwin.
Christian Tismer pointed out the high cost of the loop overhead and
function call overhead for 'c' * n where n is large. Accordingly,
the new code only makes lg2(n) loops.
Interestingly, 'c' * 1000 * 1000 ran a bit faster with old code. At some
point, the loop and function call overhead became cheaper than invalidating
the cache with lengthy memcpys. But for more typical sizes of n, the new
code runs much faster and for larger values of n it runs only a bit slower.