Stefan Krah [Sat, 16 Jun 2012 17:45:35 +0000 (19:45 +0200)]
1) State the relative errors of the power functions for integer exponents.
2) _mpd_qpow_mpd(): Abort the loop for all specials, not only infinity.
3) _mpd_qpow_mpd(): Make the function more general and distinguish between
zero clamping and folding down the exponent. The latter case is currently
handled by setting context->clamp to 0 before calling the function.
4) _mpd_qpow_int(): Add one to the work precision in case of a negative
exponent. This is to get the same relative error (0.1 * 10**-prec)
for both positive and negative exponents. The previous relative
error for negative exponents was (0.2 * 10**-prec).
Both errors are _before_ the final rounding to the context precision.
Brett Cannon [Sat, 16 Jun 2012 00:00:53 +0000 (20:00 -0400)]
Issue #14938: importlib.abc.SourceLoader.is_package() now takes the
module name into consideration when determining whether a module is a
package or not. This prevents importing a module's __init__ module
directly and having it considered a package, which can lead to
duplicate sub-modules.
Brett Cannon [Fri, 15 Jun 2012 23:39:06 +0000 (19:39 -0400)]
Issue #13959: Add to imp.find_module() and load_module's docstrings
that they are deprecated (previous commit documented this fact in the
module docs).
Brett Cannon [Fri, 15 Jun 2012 23:21:07 +0000 (19:21 -0400)]
Closes issue #14982: Document that pkgutil's walk_packages() and
iter_modules() requires iter_modules() be defined on an importer. The
importers in importlib do not define this non-standard method.
Eli Bendersky [Fri, 15 Jun 2012 06:03:19 +0000 (09:03 +0300)]
Removed _SimpleElementPath and its flaky test. The test monkey-patches the module, which causes other failures and fails itself depending on the order tests are run.
Eli Bendersky [Fri, 15 Jun 2012 04:42:50 +0000 (07:42 +0300)]
Replace the iter/itertext methods of Element in _elementtree with true C implementations, instead of the bootstrapped Python code. In addition to being cleaner (removing the last remains of the bootstrapping code in _elementtree), this gives a 10x performance boost for iter() on large documents.
Also reorganized the tests a bit to be more robust.
Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fields
in struct tm, time.struct_time objects returned by time.gmtime(),
time.localtime() and time.strptime() functions now have tm_zone and
tm_gmtoff attributes. Original patch by Paul Boddie.
Victor Stinner [Tue, 12 Jun 2012 20:46:37 +0000 (22:46 +0200)]
PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() result
Fix also its value on Windows and Linux according to its documentation:
"adjustable" indicates if the clock *can be* adjusted, not if it is or was
adjusted.
In most cases, it is not possible to indicate if a clock is or was adjusted.
Stefan Krah [Tue, 12 Jun 2012 19:06:06 +0000 (21:06 +0200)]
1) Fix signature of _mpd_qpow_uint(): contrary to the comment base is constant.
2) Abort the loop for all specials, not only infinity.
3) Make the function more general and distinguish between zero clamping
and folding down the exponent. The latter case is currently handled
by setting context->clamp to 0 before calling the function.
R David Murray [Sat, 9 Jun 2012 02:45:46 +0000 (22:45 -0400)]
Now that Defects are Exception subclasses, call super.
The behavior of MessageDefect is legacy behavior. The chances anyone is
actually using the undocumented 'line' attribute is low, but it costs
little to retain backward compatibility. Although one of the costs is
having to restore normal exception behavior in HeaderDefect. On the
other hand, I'll probably add some specialized behavior there later.
Hynek Schlawack [Fri, 8 Jun 2012 13:21:21 +0000 (15:21 +0200)]
#14814: Remove redundant code from ipaddress.IPv6Network
The strict checks and netmask computing don't make sense if constructed with
a ALL_ONES mask based on addresses. Also fix a bug due to mis-indentation of
a return statement in the same code block.
Terry Jan Reedy [Thu, 7 Jun 2012 23:41:04 +0000 (19:41 -0400)]
Issue #12510: Revise and triple # of calltip tests, with an eye to unittest
use. Make the get_entity 'method' a module function as it did not use 'self'.
Delete buggy _find_constructor function that is not needed, at least in 3.x.
Revise get_argspec so all tests pass. Add and fix NEWS entries.
Victor Stinner [Tue, 5 Jun 2012 11:43:22 +0000 (13:43 +0200)]
Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
open() and io.TextIOWrapper are now calling locale.getpreferredencoding(False)
instead of locale.getpreferredencoding() in text mode if the encoding is not
specified. Don't change temporary the locale encoding using locale.setlocale(),
use the current locale encoding instead of the user preferred encoding.
Explain also in open() documentation that locale.getpreferredencoding(False) is
called if the encoding is not specified.
Hynek Schlawack [Tue, 5 Jun 2012 09:55:58 +0000 (11:55 +0200)]
#14814: ipaddress: refactor dup code, minor janitoring, bump coverage
- remove duplicate netmask/hostmask code
- make two ifs more pythonic
- remove packed property for networks
- some minor pep8 stuff
- Test coverage is now at 97%, the rest are mostly unreachable safeguards.