Commit Graph

146 Commits

Author SHA1 Message Date
Victor Stinner 18e95b4176 bpo-31234: Join threads in tests (#3572)
Call thread.join() on threads to prevent the "dangling threads"
warning.
2017-09-14 08:43:04 -07:00
Antoine Pitrou a6a4dc816d bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00
Victor Stinner d6debb24e0 bpo-29919: Remove unused imports found by pyflakes (#137)
Make also minor PEP8 coding style fixes on modified imports.
2017-03-27 16:05:26 +02:00
Andrew Nester 6d1dece06d Fixed #29534 - _decimal difference with _pydecimal (#65) 2017-02-14 18:22:55 +00:00
Serhiy Storchaka 70d28a184c Remove unused imports. 2016-12-16 20:00:15 +02:00
Brett Cannon a721abac29 Issue #26331: Implement the parsing part of PEP 515.
Thanks to Georg Brandl for the patch.
2016-09-09 14:57:09 -07:00
Stefan Krah 243d8a7866 Merge 3.5. 2016-07-17 14:12:59 +02:00
Stefan Krah 8c126f17f0 Issue #26974: Fix segfault in the presence of absurd subclassing. Proactively
eliminate all internal uses of overridden methods.
2016-07-17 14:01:42 +02:00
Stefan Krah 8113f490c5 Merge 3.5. 2016-06-20 12:10:42 +02:00
Stefan Krah 6817c59cf0 Issue #27006: from_float(): call the subclass' __new__() and __init__(). 2016-06-20 12:10:13 +02:00
Stefan Krah 66e9d03bf4 Issue #26621: Update libmpdec version and remove unnecessary test case. 2016-03-23 20:50:10 +01:00
Stefan Krah 53f2e0ad45 Issue #25928: Add Decimal.as_integer_ratio(). Python parts and docs by
Mark Dickinson.
2015-12-28 23:02:02 +01:00
Serhiy Storchaka 65ee4674e2 Issue #22777: Test pickling with all protocols. 2014-12-15 14:06:02 +02:00
Serhiy Storchaka bad1257c96 Issue #22777: Test pickling with all protocols. 2014-12-15 14:03:42 +02:00
Stefan Krah b578f8a1ef Issue #19232: Speed up decimal import. Additionally, since _decimal is
self-contained, this change facilitates maintenance and the Python version
can be easily imported for experimentation.
2014-09-10 17:58:15 +02:00
Stefan Krah 9ea83cff47 Merge 3.4. 2014-08-26 20:47:32 +02:00
Stefan Krah 298131a448 Issue #22090: Fix '%' formatting for infinities and NaNs. 2014-08-26 20:46:49 +02:00
Zachary Ware e7e1375e57 Issue #18492: Merge with 3.4 2014-06-02 16:04:25 -05:00
Zachary Ware 66f2928479 Issue #18492: Allow all resources when tests are not run by regrtest.py.
This changeset also includes cleanup allowed by this behavior change.
2014-06-02 16:01:29 -05:00
Stefan Krah 6b794b8b59 Fix typo and tests without docstrings. 2014-05-01 17:42:33 +02:00
Stefan Krah 5de1f82464 Issue #21407: _decimal now supports function signatures. 2014-05-01 15:53:42 +02:00
Stefan Krah b151f8f60b Issue #10650: Remove the non-standard 'watchexp' parameter from the
Decimal.quantize() method in the Python version.  It had never been
present in the C version.
2014-04-30 19:15:38 +02:00
Stefan Krah 8fb74a35da Issue #21374: Fix pickling of DecimalTuple. 2014-04-29 18:24:50 +02:00
Stefan Krah f1d4e42195 Issue #21374: Fix pickling of DecimalTuple. 2014-04-29 18:23:35 +02:00
Zachary Ware 0f533acf88 Avoid UnicodeEncodeError by only printing ASCII.
This fixes running test_decimal in verbose mode on Windows,
which I broke in issue #19572.
2013-12-12 10:32:16 -06:00
Zachary Ware 9fe6d86709 Issue 19572: More silently skipped tests explicitly skipped. 2013-12-08 00:20:35 -06:00
Stefan Krah 45059eb1d0 1) Prepare libmpdec for the 2.4.0 release. None of the following changes affects
_decimal:

      o Make all "mpd_t to C integer" conversion functions available in both the
        64-bit and the 32-bit versions.

      o Make all mixed mpd_t/C integer arithmetic functions available in the
        32-bit version.

      o Better handling of __STDC_LIMIT_MACROS for C++ users.

      o Add struct tags (at the request of C++ users).

2) Check for libmpdec.so.2 if --with-system-libmpdec is used.
2013-11-24 19:44:57 +01:00
Serhiy Storchaka 9594942716 Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
2013-08-27 19:40:23 +03:00
Stefan Krah 891ca9e06a Backport bff16086f03b and bcaaaa00425b. 2013-05-29 19:14:17 +02:00
Stefan Krah 6edda14b29 Issue #17768: Support newline fill character in decimal.py and NUL fill
character in _decimal.c.
2013-05-29 15:45:38 +02:00
Terry Jan Reedy 0f84764a09 Issue #17047: remove doubled words added in 3.3
as reported by Serhiy Storchaka and Matthew Barnett.
2013-03-11 18:34:00 -04:00
Stefan Krah eb8c451bd2 Since the return type of format() is not a Decimal, raise ValueError instead of
InvalidOperation if the format specification (width, prec) exceeds the internal
limits of libmpdec.
2013-01-24 15:22:33 +01:00
Stefan Krah 59a4a93f43 Issue #16422: Use strings for rounding mode constants for better readability
and pickling compatibility.
2013-01-16 12:58:59 +01:00
Stefan Krah 9a4ff437d1 Issue #15783: Support None default values in the Context() constructor. 2012-12-16 21:10:35 +01:00
Stefan Krah 040e311826 Issue #15783: Except for the number methods, the C version of decimal now
supports all None default values present in decimal.py. These values were
largely undocumented.
2012-12-15 22:33:33 +01:00
Stefan Krah 6e467049c6 Accept Unicode legacy strings in the Decimal constructor. 2012-11-10 23:09:04 +01:00
Stefan Krah 0f82b76b57 Issue #16431: Finally, consider all permutations. 2012-11-08 11:17:29 +01:00
Stefan Krah ed16eff57e Issue #16431: Also fix the opposite direction. 2012-11-07 23:47:19 +01:00
Stefan Krah f4abc7b8a0 Issue #16431: Use the type information when constructing a Decimal subtype
from a Decimal argument.
2012-11-07 23:12:25 +01:00
Stefan Krah 8a491a8eef Closes #16080: The decorator ignores failed attempts to set the required
locale, so an additional check is required.
2012-09-28 17:17:11 +02:00
Stefan Krah 6fb204af79 Issue #16080: Use run_with_locale() decorator to reset the locale properly. 2012-09-28 16:18:54 +02:00
Stefan Krah 76e12179c5 Issue #15882: Change _decimal to accept any coefficient tuple when
constructing infinities. This is done for backwards compatibility
with decimal.py: Infinity coefficients are undefined in _decimal
(in accordance with the specification).
2012-09-10 19:34:58 +02:00
Mark Dickinson fc33d4ce0a Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs. 2012-08-24 18:53:10 +01:00
Stefan Krah ff3eca0cc3 Allow printing a leading '-' and the maximum number of exponent digits
rather than raising RuntimeError (allocated space is sufficient for the
additional character).
2012-04-05 15:46:19 +02:00
Stefan Krah 0774e9b9f5 Raise InvalidOperation if exponents of zeros are clamped during exact
conversion in the Decimal constructor. Exact here refers to the
representation and not to the value (clamping does not change the value).
2012-04-05 15:21:58 +02:00
Stefan Krah 9d2801095f Testing the implicit initialization of the thread local context on first
access fails (expectedly) if other modules have already used decimal. The
only option is to remove the test.
2012-04-02 19:10:20 +02:00
Stefan Krah 38548ad006 Whitespace. 2012-04-02 15:10:36 +02:00
Stefan Krah 5100171d81 Clear the context flags if a context is initialized from the DefaultContext. 2012-04-02 15:02:21 +02:00
Stefan Krah fe17b2bc77 Raise MemoryError instead of InvalidOperation/MallocError for compatibility
with decimal.py. The standard specifies InsufficientStorage (MallocError) as
a sub-condition of InvalidOperation. This allows a calculation to continue
with NaN results when allocation fails.
2012-03-25 18:59:21 +02:00
Stefan Krah b6405efd1b Use the same exception hierarchy as decimal.py. FloatOperation now also
inherits from TypeError. Cleanup in module initialization to make repeated
import failures robust.
2012-03-23 14:46:48 +01:00