Tim Peters [Thu, 19 Aug 2004 06:49:33 +0000 (06:49 +0000)]
ELLIPSIS implementation: an ellipsis couldn't match nothing if it
appeared at the end of a line. Repaired that. Also noted that it's
too easy to provoke this implementation into requiring exponential
time, and especially when a test fails. I'll replace the implementation
with an always-efficient one later.
Brett Cannon [Thu, 19 Aug 2004 03:48:24 +0000 (03:48 +0000)]
Rewrite test_order so as to be more "proper". Originally relied on an
error based on decorating with staticmethod too soon for the code to execute.
This meant that if the test didn't pass it just errored out. Now if the test
doesn't pass it leads to a failure instead.
Fred Drake [Thu, 19 Aug 2004 01:37:48 +0000 (01:37 +0000)]
fix SF bug #1008690: Incorrect <link rel="index"> href in Tutorial
The make_head_and_body() function used a hardcoded value for the
<link> element for the index; this patch causes the proper output
filename to be captured during the transformation phase so it can be
used during the page assembly phase.
Patch #1006219: let inspect.getsource show '@' decorators and add tests for
this (which are rather ugly, but it'll have to do until test_inspect gets a
major overhaul and a conversion to unittest). Thanks Simon Percivall!
Move the bytecode optimizer upstream so that its results are saved in pyc
files and not re-optimized upon import. Saves a bit of startup time while
still remaining decoupled from the rest of the compiler.
As a side benefit, handcoded bytecode is not run through the optimizer
when new code objects are created. Hopefully, a handcoder has already
created exactly what they want to have run.
(Idea suggested by Armin Rigo and Michael Hudson. Initially avoided
because of worries about compiler coupling; however, only the nexus
point needed to be moved so there won't be a conflict when the AST
branch is loaded.)
Deprecate sys.exitfunc in favor of the atexit module.
Per Guido, sys.exitfunc will be kept around for backwards compatability
but atexit will become the one preferred way to do it.
Edward Loper [Tue, 17 Aug 2004 16:37:12 +0000 (16:37 +0000)]
Fixed bug in line-number finding for examples (DocTestParser wasn't
updating line numbers correctly for bare prompts & examples containing
only comments).
Remove test of obsolete trim() operation which was supplanted by
normalize() in Draft 1.06 (9 October 2002):
The normalize operation has been added; it reduces a number to a
canonical form. (This replaces the trim operator, which only
removed trailing fractional zeros.)
Use readline/raw_input() in pydoc.Helper.interact if available and self.input
is sys.stdin. Based on a patch (#726204) by Dmitry Vasiliev and a comment from
Guido in an older patch (#549901).
Revise max() and min() to comply with the 8/2/2004 update to the specification
(version 1.45):
The max and min operations follow the rules in the current IEEE 754 revision draft:
if one operand is a quiet NaN and the other is number, then the number is always returned
if both operands are finite and equal in numerical value then an ordering is applied:
if the signs differ then max returns the operand with the positive sign and
min returns the operand with the negative sign; if the signs are the same then
the exponent is used to select the result.
* Dynamically build a list of files to be tested (necessary because
version 2.39 of dectest.zip adds some new test files and because
some existing test files were getting skipped).
* Remove two docstrings which cluttered unittest's output.
* Simplify a for-loop with a list comprehension.
SF bug #805304: super instances don't support item assignment
Document a nuance of super(). It is designed to work well with dotted
attribute lookup but not with equivalent implicit lookups using operators
or statements.
Matthias Klose [Mon, 16 Aug 2004 11:35:51 +0000 (11:35 +0000)]
The attached patch fixes FTBFS on GNU/k*BSD. The problem happens on GNU/k*BSD
because GNU/k*BSD uses gnu pth to provide pthreads, but will also happen on any
system that does the same.
python fails to build because it doesn't detect gnu pth in pthread
emulation. See C comments in patch for details.
* Mention the use case of I/O running concurrent with a computational
thread.
* Be a tad more forceful about recommending Queue over other approaches
to synchonization.
* Eliminate discussion around having a single interpreter. This is a
more advanced discussion that belongs in the library reference and
in a section on extending and embedding.
* Discuss representation error versus loss of significance.
* Document special values including qNaN, sNaN, +0, -0.
* Show the suprising display of non-normalized zero values.
Skip Montanaro [Sun, 15 Aug 2004 14:32:06 +0000 (14:32 +0000)]
Add get_history_item and replace_history_item functions to the readline
module. Closes patch #675551. My apologies to Michal Vitecek for taking so
long to process this.
bug #989672: pdb.doc and the help messages for the help_d and help_u methods
of the pdb.Pdb class gives have been corrected. d(own) goes to a newer frame,
u(p) to an older frame, not the other way around.
bug #990669: os.path.realpath() will resolve symlinks before normalizing the
path, as normalizing the path may alter the meaning of the path if it contains
symlinks.
Also add tests for infinite symlink loops and parent symlinks that need to be
resolved.
bug 990669: os.path.normpath may alter the meaning of a path if it contains
symbolic links. This has been documented in a comment since 1992, but is now in
the library reference as well.
Brett Cannon [Fri, 13 Aug 2004 18:46:24 +0000 (18:46 +0000)]
'inspect' was not listing the functions in a module properly if the module was
reached through a symlink (was comparing path of module to path to function and
were not matching because of the symlink). os.path.realpath() is now used to
solve this discrepency.
Closes bug #570300. Thanks Johannes Gijsbers for the fix.
Tim Peters [Fri, 13 Aug 2004 03:55:05 +0000 (03:55 +0000)]
Doctest has new traceback gimmicks in 2.4. While trying to document
them (which they are now), I had to rewrite the code to understand
it. This has got to be the most DWIM part of doctest -- but in context
is really necessary.
Fred Drake [Fri, 13 Aug 2004 03:12:57 +0000 (03:12 +0000)]
make exception propogation more efficient; this avoids having Expat parse
the remaining data in the buffer (which it had done happily without reporting
any results)
this depends on a new feature in Expat added in 1.95.8
Tim Peters [Thu, 12 Aug 2004 18:37:10 +0000 (18:37 +0000)]
Boosted the stack reservation for python.exe and python_w.exe from the
default 1MB to 2 million bytes. The test suite passes with -uall again
(test_compiler no longer drives WinXP into an insane state).
Edward Loper [Thu, 12 Aug 2004 02:43:49 +0000 (02:43 +0000)]
In output_difference(), replace blank lines in `want` with <BLANKLINE>
(rather than replacing <BLANKLINE> with blank lines in `got`). This
makes it easier to see what's intended.
Edward Loper [Thu, 12 Aug 2004 02:41:30 +0000 (02:41 +0000)]
- Changed output of DocTestParser.get_program() to make it easier to
visually distinguish the expected output from the comments (use
"##" to mark expected outputs, and "#" to mark comments).
- If the string given to DocTestParser.get_program() is indented, then
strip its indentation. (In particular, find the min indentation of
non-blank lines, and strip that indentation from all lines.)
Edward Loper [Thu, 12 Aug 2004 02:34:27 +0000 (02:34 +0000)]
- Added __docformat__
- Added comments for some regexps
- If the traceback type/message don't match, then still print full
traceback in report_failure (not just the first & last lines)
- Renamed DocTestRunner.__failure_header -> _failure_header
Edward Loper [Thu, 12 Aug 2004 02:27:44 +0000 (02:27 +0000)]
- Changed option directives to be example-specific. (i.e., they now
modify option flags for a single example; they do not turn options
on or off.)
- Added "indent" and "options" attributes for Example
- Got rid of add_newlines param to DocTestParser._parse_example (it's
no longer needed; Example's constructor now takes care of it).
- Added some docstrings