summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464)Victor Stinner2021-05-311-2/+1
| | | | | | * _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function.
* bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493)Raymond Hettinger2021-04-221-4/+1
|
* bpo-41369: Finish updating the vendored libmpdec to version 2.5.1 (GH-24962)Antoine Pitrou2021-03-3024-116/+1967
| | | | | Complete the update to libmpdec-2.5.1. Co-authored-by: Stefan Krah <skrah@bytereef.org>
* bpo-43422: Revert _decimal C API addition (GH-24960)Antoine Pitrou2021-03-214-276/+19
| | | | | | | | | Stefan Krah requested the reversal of these (unreleased) changes, quoting him: > The capsule API does not meet my testing standards, since I've focused on the upstream mpdecimal in the last couple of months. > Additionally, I'd like to refine the API, perhaps together with the Arrow community. Automerge-Triggered-By: GH:pitrou
* bpo-41798: Allocate _decimal extension module C API on the heap (GH-24117)Erlend Egeberg Aasland2021-01-061-5/+20
|
* bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)Victor Stinner2020-12-011-1/+1
| | | | | | | | | No longer use deprecated aliases to functions: * Replace PyObject_MALLOC() with PyObject_Malloc() * Replace PyObject_REALLOC() with PyObject_Realloc() * Replace PyObject_FREE() with PyObject_Free() * Replace PyObject_Del() with PyObject_Free() * Replace PyObject_DEL() with PyObject_Free()
* bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and ↵Serhiy Storchaka2020-10-261-17/+30
| | | | | | | | | | | _PyDict_GetItemId. (GH-22648) These functions are considered not safe because they suppress all internal errors and can return wrong result. PyDict_GetItemString and _PyDict_GetItemId can also silence current exception in rare cases. Remove no longer used _PyDict_GetItemId. Add _PyDict_ContainsId and rename _PyDict_Contains into _PyDict_Contains_KnownHash.
* Revert "bpo-26680: Incorporate is_integer in all built-in and standard ↵Raymond Hettinger2020-10-072-14/+5
| | | | | library numeric types (GH-6121)" (GH-22584) This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.
* bpo-26680: Incorporate is_integer in all built-in and standard library ↵Robert Smallshire2020-10-012-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | numeric types (GH-6121) * bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer(). The int.is_integer() method always returns True. * bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True. * bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int. This default implementation is intended to reduce the workload for subclass implementers. It is not robust in the presence of infinities or NaNs and may have suboptimal performance for other types. * bpo-26680: Adds Rational.is_integer which returns True if the denominator is one. This implementation assumes the Rational is represented in it's lowest form, as required by the class docstring. * bpo-26680: Adds Integral.is_integer which always returns True. * bpo-26680: Adds tests for Fraction.is_integer called as an instance method. The tests for the Rational abstract base class use an unbound method to sidestep the inability to directly instantiate Rational. These tests check that everything works correct as an instance method. * bpo-26680: Updates documentation for Real.is_integer and built-ins int and float. The call x.is_integer() is now listed in the table of operations which apply to all numeric types except complex, with a reference to the full documentation for Real.is_integer(). Mention of is_integer() has been removed from the section 'Additional Methods on Float'. The documentation for Real.is_integer() describes its purpose, and mentions that it should be overridden for performance reasons, or to handle special values like NaN. * bpo-26680: Adds Decimal.is_integer to the Python and C implementations. The C implementation of Decimal already implements and uses mpd_isinteger internally, we just expose the existing function to Python. The Python implementation uses internal conversion to integer using to_integral_value(). In both cases, the corresponding context methods are also implemented. Tests and documentation are included. * bpo-26680: Updates the ACKS file. * bpo-26680: NEWS entries for int, the numeric ABCs and Decimal. Co-authored-by: Robert Smallshire <rob@sixty-north.com>
* bpo-40878: xlc cannot handle C99 extern inline. (GH-21887)Stefan Krah2020-08-151-1/+1
| | | This applies to the default "extc99" mode. Python does not compile with "stdc99".
* Catch all skip_handler cases (GH-21842)Stefan Krah2020-08-121-3/+3
|
* Call randseed() before other imports in deccheck.py (GH-21834)Stefan Krah2020-08-111-8/+8
|
* Replace import_fresh_module in decimal test files (GH-21815)Stefan Krah2020-08-103-12/+9
|
* bpo-41324 Add a minimal decimal capsule API (#21519)Stefan Krah2020-08-102-7/+252
|
* bpo-41369 Update to libmpdec-2.5.1: new features (GH-21593)Stefan Krah2020-07-222-0/+377
|
* bpo-41302: Fix build with system libmpdec (GH-21481)Felix Yan2020-07-152-6/+5
| | | | | | | Move definition of UNUSED from modified headers of libmpdec to _decimal.c itself. This makes the vendored source closer to the standalone library and fixes build with --with-system-libmpdec. Tested to build fine with either system libmpdec or the vendored one.
* bpo-41100: fix _decimal for arm64 Mac OS (GH-21228)Lawrence D'Anna2020-06-301-0/+3
| | | Patch by Lawrence Danna.
* bpo-40874 Update the required libmpdec version for the decimal module (GH-21202)Stefan Krah2020-06-281-2/+2
|
* Add multicore support to deccheck.py. (GH-20731)Stefan Krah2020-06-081-21/+110
|
* bpo-40874: Update to libmpdec-2.5.0 (GH-20652)Stefan Krah2020-06-0538-296/+502
|
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+0
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-40268: Remove explicit pythread.h includes (#19529)Victor Stinner2020-04-151-1/+0
| | | | Remove explicit pythread.h includes: it is always included by Python.h.
* bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode ↵Serhiy Storchaka2020-04-111-2/+2
| | | | data. (GH-19345)
* Cosmetic change to match the surrounding code. (#18704)Stefan Krah2020-02-291-1/+1
|
* bpo-39794: Add --without-decimal-contextvar (#18702)Stefan Krah2020-02-292-29/+176
|
* bpo-39576: Prevent memory error for overly optimistic precisions (GH-18581)Stefan Krah2020-02-212-6/+210
|
* Use the new recommended number of repetitions in the refleak tests. (#18569)Stefan Krah2020-02-201-1/+1
|
* Update runall.bat to the latest Windows build system. (#18571)Stefan Krah2020-02-201-41/+59
|
* Valgrind no longer supports --db-attach=yes. (#18568)Stefan Krah2020-02-201-1/+1
|
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-2/+2
|
* bpo-39573: Use Py_SET_SIZE() function (GH-18402)Victor Stinner2020-02-071-2/+2
| | | | Replace direct acccess to PyVarObject.ob_size with usage of the Py_SET_SIZE() function.
* bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393)Victor Stinner2020-02-071-3/+3
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* Revert mode change that loses information in directory listings on Linux. ↵Stefan Krah2019-08-211-0/+0
| | | | (#15366)
* Unmark files as executable that can't actually be executed. (GH-15353)Greg Price2019-08-211-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are plenty of legitimate scripts in the tree that begin with a `#!`, but also a few that seem to be marked executable by mistake. Found them with this command -- it gets executable files known to Git, filters to the ones that don't start with a `#!`, and then unmarks them as executable: $ git ls-files --stage \ | perl -lane 'print $F[3] if (!/^100644/)' \ | while read f; do head -c2 "$f" | grep -qxF '#!' \ || chmod a-x "$f"; \ done Looking at the list by hand confirms that we didn't sweep up any files that should have the executable bit after all. In particular * The `.psd` files are images from Photoshop. * The `.bat` files sure look like things that can be run. But we have lots of other `.bat` files, and they don't have this bit set, so it must not be needed for them. Automerge-Triggered-By: @benjaminp
* Rename memory.c to mpalloc.c for consistency with the header file. (#14687)Stefan Krah2019-07-102-1/+1
|
* Really remove vcstdint.h. (#14686)Stefan Krah2019-07-103-234/+1
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-8/+8
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36793: Remove unneeded __str__ definitions. (GH-13081)Serhiy Storchaka2019-05-061-1/+1
| | | | Classes that define __str__ the same as __repr__ can just inherit it from object.
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-38/+38
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* bpo-35059, libmpdec: Add missing EXTINLINE in mpdecimal.h (GH-10128)Victor Stinner2018-10-261-5/+5
| | | | | | | | | | | | | Declare functions with EXTINLINE: * mpd_del() * mpd_uint_zero() * mpd_qresize() * mpd_qresize_zero() * mpd_minalloc() These functions are implemented with "inline" or "ALWAYS_INLINE", but declared without inline which cause linker error on Visual Studio in Debug mode when using /Ob1.
* bpo-34762: Update PyContext* to PyObject* in asyncio and decimal (GH-9609)Yury Selivanov2018-09-271-3/+3
| | | This fixes various compiler warnings.
* Fix some warnings produced by different compilers. (#5593)Serhiy Storchaka2018-02-091-0/+6
|
* bpo-25988: Emit a warning when use or import ABCs from 'collections'. (#5460)Serhiy Storchaka2018-01-311-1/+5
|
* bpo-32630: Use contextvars in decimal (GH-5278)Yury Selivanov2018-01-271-89/+31
|
* bpo-31406: Fix crash due to lack of type checking in subclassing. (#3477)Stefan Krah2017-09-101-5/+14
|
* bpo-31403: Remove WITHOUT_THREADS from _decimal. (#3474)Stefan Krah2017-09-092-113/+16
|
* bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142)Stefan Krah2017-08-181-0/+6
|
* bpo-27425: Be more explicit in .gitattributes (GH-840)Zachary Ware2017-06-101-111/+111
| | | Updates checked-in line endings on several files.
* Correct typo (#976)Angus Hollands2017-04-031-1/+1
|
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+0
| | | Make also minor PEP8 coding style fixes on modified imports.