summaryrefslogtreecommitdiff
path: root/Objects/longobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "bpo-38096: Clean up the "struct sequence" / "named tuple" docs ↵revert-15895-named_tuple_conceptRaymond Hettinger2019-09-111-1/+1
| | | | | | (GH-15895)" This reverts commit 7117074410118086938044c7a4ef6846ec1662b2.
* bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895)Raymond Hettinger2019-09-111-1/+1
| | | | | | | | * bpo-38096: Clean up the "struct sequence" / "named tuple" docs * Fix remaining occurrences of "struct sequence" * Repair a user visible docstring
* bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)Jordon Xu2019-09-101-2/+2
|
* replace inline function `is_small_int` with a macro version (GH-15710)animalize2019-09-051-13/+9
|
* Make PyXXX_Fini() functions private (GH-15531)Victor Stinner2019-08-271-1/+1
| | | | | For example, rename PyTuple_Fini() to _PyTuple_Fini(). These functions are only declared in the internal C API.
* bpo-37812: Convert CHECK_SMALL_INT macro to a function so the return is ↵Greg Price2019-08-241-11/+25
| | | | explicit. (GH-15216)
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-2/+1
|
* bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860)Zackery Spytz2019-06-061-2/+2
|
* bpo-36027: Really fix "incompatible pointer type" compiler warning (GH-13761)Petr Viktorin2019-06-031-1/+1
| | | Apologies for the earlier hasty attempt.
* bpo-36027 bpo-36974: Fix "incompatible pointer type" compiler warnings ↵Petr Viktorin2019-06-031-1/+1
| | | | (GH-13758)
* bpo-36027: Extend three-argument pow to negative second argument (GH-13266)Mark Dickinson2019-06-021-12/+118
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-301-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* remove unnecessary tp_dealloc (GH-13647)Inada Naoki2019-05-291-7/+1
|
* bpo-36957: Add _PyLong_Rshift() and _PyLong_Lshift(). (GH-13416)Serhiy Storchaka2019-05-191-28/+75
|
* 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-36292: Mark unreachable code as such in long bitwise ops (GH-12333)stratakis2019-03-181-4/+2
|
* bpo-36048: Use __index__() instead of __int__() for implicit conversion if ↵Serhiy Storchaka2019-02-251-9/+76
| | | | | | available. (GH-11952) Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
* bpo-36063: Minor performance tweak in long_divmod(). (GH-11915)Sergey Fedoseev2019-02-211-2/+2
|
* bpo-35713: Split _Py_InitializeCore into subfunctions (GH-11650)Victor Stinner2019-01-221-1/+2
| | | | | | | | | | | | | | * Split _Py_InitializeCore_impl() into subfunctions: add multiple pycore_init_xxx() functions * Preliminary sys.stderr is now set earlier to get an usable sys.stderr ealier. * Move code into _Py_Initialize_ReconfigureCore() to be able to call it from _Py_InitializeCore(). * Split _PyExc_Init(): create a new _PyBuiltins_AddExceptions() function. * Call _PyExc_Init() earlier in _Py_InitializeCore_impl() and new_interpreter() to get working exceptions earlier. * _Py_ReadyTypes() now returns _PyInitError rather than calling Py_FatalError(). * Misc code cleanup
* bpo-35059: PyObject_INIT() casts to PyObject* (GH-10674)Victor Stinner2018-11-231-2/+2
| | | | | | PyObject_INIT() and PyObject_INIT_VAR() now cast their first argument to PyObject*, as done in Python 3.7. Revert partially commit b4435e20a92af474f117b78b98ddc6f515363af5.
* bpo-35064 prefix smelly symbols that appear with COUNT_ALLOCS with _Py_ ↵Pablo Galindo2018-10-281-3/+3
| | | | | | | (GH-10152) Configuring python with ./configure --with-pydebug CFLAGS="-D COUNT_ALLOCS -O0" makes "make smelly" fail as some symbols were being exported without the "Py_" or "_Py" prefixes.
* bpo-35059: Convert PyObject_INIT() to function (GH-10077)Victor Stinner2018-10-261-2/+2
| | | | | * Convert PyObject_INIT() and PyObject_INIT_VAR() macros to static inline functions. * Fix usage of these functions: cast to PyObject* or PyVarObject*.
* bpo-33073: Rework int.as_integer_ratio() implementation (GH-9303)Serhiy Storchaka2018-10-191-6/+1
| | | | | * Simplify the C code. * Simplify tests and make them more strict and robust. * Add references in the documentation.
* bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() ↵Zackery Spytz2018-10-061-1/+1
| | | | | | | (GH-9705) The _PyLong_FromByteArray() call in int_from_bytes_impl() was unchecked.
* Fix compiler warning with a type cast (GH-9300)Raymond Hettinger2018-09-141-1/+1
|
* Fix-up parenthesis, organization, and NULL check (GH-9297)Raymond Hettinger2018-09-141-6/+11
|
* bpo-33073: Adding as_integer_ratio to ints. (GH-8750)Lisa Roach2018-09-131-0/+31
|
* bpo-20260: Implement non-bitwise unsigned int converters for Argument ↵Serhiy Storchaka2018-07-261-0/+96
| | | | Clinic. (GH-8434)
* bpo-33012: Fix invalid function casts for long_long. (GH-6652)Serhiy Storchaka2018-04-301-17/+25
| | | | | long_long() was used with three function types: PyCFunction, getter and unaryfunction.
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-10/+10
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* PyLong_FromString(): fix Coverity CID 1424951 (#4738)Victor Stinner2017-12-081-3/+2
| | | | | | | | | | | Explicitly cast digits (Py_ssize_t) to double to fix the following false-alarm warning from Coverity: "fsize_z = digits * log_base_BASE[base] + 1;" CID 1424951: Incorrect expression (UNINTENDED_INTEGER_DIVISION) Dividing integer expressions "9223372036854775783UL" and "4UL", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored.
* bpo-31619: Fixed integer overflow in converting huge strings to int. (#3884)Serhiy Storchaka2017-12-031-3/+11
|
* bpo-16055: Fixes incorrect error text for int('1', base=1000) (#4376)Sanyam Khurana2017-11-131-1/+1
| | | | | | * bpo-16055: Fixes incorrect error text for int('1', base=1000) * bpo-16055: Address review comments
* bpo-31979: Simplify transforming decimals to ASCII (#4336)Serhiy Storchaka2017-11-131-12/+9
| | | | | in int(), float() and complex() parsers. This also speeds up parsing non-ASCII numbers by around 20%.
* 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-141-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-081-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-061-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.