summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵stratakis2017-11-021-30/+1
| | | | functions (GH-793)
* bpo-31619: Fixed a ValueError when convert a string with large number of ↵Serhiy Storchaka2017-10-031-4/+4
| | | | | underscores (#3827) to integer with binary base.
* bpo-31338 (#3374)Barry Warsaw2017-09-151-4/+3
| | | | | | | * Add Py_UNREACHABLE() as an alias to abort(). * Use Py_UNREACHABLE() instead of assert(0) * Convert more unreachable code to use Py_UNREACHABLE() * Document Py_UNREACHABLE() and a few other macros.
* bpo-29816: Shift operation now has less opportunity to raise OverflowError. ↵Serhiy Storchaka2017-03-301-22/+48
| | | | | | | (#680) ValueError always is raised rather than OverflowError for negative counts. Shifting zero with non-negative count always returns zero.
* bpo-29878: Add global instances of int for 0 and 1. (#852)Serhiy Storchaka2017-03-301-26/+21
|
* bpo-29793: Convert some builtin types constructors to Argument Clinic. (#615)Serhiy Storchaka2017-03-191-10/+14
|
* bpo-29749: Update int() docstring (GH-565)svelankar2017-03-091-1/+1
| | | The docstring did not properly represent the fact that the argument to int() was positional-only.
* bpo-29695: Remove bad keyword parameters in int(), bool(), float(), list() ↵Serhiy Storchaka2017-03-061-7/+1
| | | | and tuple(). (#518)
* remove 3 redundant casts in Objects/longobject.c (#445)orenmn2017-03-061-3/+3
|
* bpo-29695: Deprecated using bad named keyword arguments in builtings: (#486)Serhiy Storchaka2017-03-051-0/+6
| | | | int(), bool(), float(), list() and tuple(). Specify the value as a positional argument instead.
* Issue #29421: Make int.to_bytes() and int.from_bytes() slightly fasterSerhiy Storchaka2017-02-021-4/+7
| | | | (10-20% for small integers).
* Issue #20185: Converted the int class to Argument Clinic.Serhiy Storchaka2017-02-011-135/+111
| | | | Based on patch by Vajrasky Kok.
* Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-1/+2
| | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-2/+1
| | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
* Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-201-1/+1
| | | | functions.
* Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-201-1/+2
| | | | UTF-8 represenatation of Unicode objects.
* Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-4/+4
|\ | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-4/+4
| |\ | | | | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| | * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-4/+4
| | | | | | | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | | Issue #28621: Sped up converting int to float by reusing faster bits countingSerhiy Storchaka2016-11-081-32/+28
| | | | | | | | | | | | implementation. Patch by Adrian Wielgosik.
* | | Issue #27111: Minor simplication to long_add and long_sub fast path code. ↵Mark Dickinson2016-09-171-6/+2
| | | | | | | | | | | | Thanks Oren Milman.
* | | Issue #27441: Remove some redundant assignments to ob_size in longobject.c. ↵Mark Dickinson2016-09-171-2/+0
| | | | | | | | | | | | Thanks Oren Milman.
* | | Issue #27222: various cleanups in long_rshift. Thanks Oren Milman.Mark Dickinson2016-09-171-11/+7
|/ /
* | Issue #25221: merge from 3.5.Mark Dickinson2016-09-101-1/+2
|\ \ | |/
| * Issue #25221: Fix corrupted result from PyLong_FromLong(0) when Python is ↵Mark Dickinson2016-09-101-1/+2
| | | | | | | | compiled with NSMALLPOSINTS = 0.
| * Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
| |
* | Issue #26331: Implement the parsing part of PEP 515.Brett Cannon2016-09-091-37/+132
| | | | | | | | Thanks to Georg Brandl for the patch.
* | replace PY_SIZE_MAX with SIZE_MAXBenjamin Peterson2016-09-071-1/+1
| |
* | replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-061-2/+2
| |
* | remove some silly defined() testsBenjamin Peterson2016-09-061-2/+2
| |
* | replace PY_LONG_LONG with long longBenjamin Peterson2016-09-061-40/+40
| |
* | require a long long data type (closes #27961)Benjamin Peterson2016-09-061-20/+0
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
| |
* | Issue #27870: A left shift of zero by a large integer no longer attempts to ↵Mark Dickinson2016-08-291-0/+5
| | | | | | | | allocate large amounts of memory.
* | Issue #25402: in int-to-decimal-string conversion, reduce intermediate ↵Mark Dickinson2016-08-291-8/+11
| | | | | | | | storage requirements and relax restriction on converting large integers. Patch by Serhiy Storchaka.
* | Issue #27214: Fix potential bug and remove useless optimization in ↵Mark Dickinson2016-08-291-2/+4
| | | | | | | | long_invert. Thanks Oren Milman.
* | Issue #27792: force int return type for modulo operations involving bools.Mark Dickinson2016-08-221-2/+5
| |
* | Untabify Objects/longobject.c.Mark Dickinson2016-08-211-2/+2
| |
* | Issue #25604: Fix minor bug in integer true division, which couldMark Dickinson2016-08-211-2/+2
| | | | | | | | have caused off-by-one-ulp results on certain platforms.
* | Issue #27786: Simplify x_sub()Victor Stinner2016-08-171-3/+1
| | | | | | | | | | The z variable is known to be a fresh number which cannot be shared, Py_SIZE() can be used directly to negate the number.
* | Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-281-2/+2
|\ \ | |/
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-2/+2
| | | | | | | | Based on patch by Ville Skyttä.
* | Issue #27073: Removed redundant checks in long_add and long_sub.Serhiy Storchaka2016-06-031-2/+10
| | | | | | | | Patch by Oren Milman.
* | Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.Serhiy Storchaka2016-05-121-21/+3
|\ \ | |/
| * Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.Serhiy Storchaka2016-05-121-21/+3
| |
* | longobject.c: fix compilation warning on Windows 64-bitVictor Stinner2016-03-231-1/+1
| | | | | | | | We know that Py_SIZE(b) is -1 or 1 an so fits into the sdigit type.
* | Issues #26289 and #26315: Optimize floor/modulo div for single-digit longsYury Selivanov2016-02-111-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Microbenchmarks show 2-2.5x improvement. Built-in 'divmod' function is now also ~10% faster. -m timeit -s "x=22331" "x//2;x//-3;x//4;x//5;x//-6;x//7;x//8;x//-99;x//100;" with patch: 0.321 without patch: 0.633 -m timeit -s "x=22331" "x%2;x%3;x%-4;x%5;x%6;x%-7;x%8;x%99;x%-100;" with patch: 0.224 without patch: 0.66 Big thanks to Serhiy Storchaka, Mark Dickinson and Victor Stinner for thorow code reviews and algorithms improvements.
* | Issue #26288: Fix commentYury Selivanov2016-02-061-3/+3
| |
* | Issue #26288: Optimize PyLong_AsDouble.Yury Selivanov2016-02-061-0/+7
| |
* | Issue #24731: Fixed crash on converting objects with special methodsSerhiy Storchaka2015-11-251-1/+1
|\ \ | |/ | | | | | | __bytes__, __trunc__, and __float__ returning instances of subclasses of bytes, int, and float to subclasses of bytes, int, and float correspondingly.