Victor Stinner
32bd68c839
bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)
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()
5 years ago
Victor Stinner
c9bc290dd6
bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995)
Use _PyLong_GetZero() and _PyLong_GetOne()
in Objects/ and Python/ directories.
5 years ago
Dong-hee Na
c0f22fb8b3
bpo-41902: Micro optimization for range.index if step is 1 (GH-22479)
5 years ago
Dong-hee Na
25492a5b59
bpo-41902: Micro optimization for compute_item of range (GH-22492)
5 years ago
Victor Stinner
384621c42f
bpo-41078: Rename pycore_tupleobject.h to pycore_tuple.h (GH-21056)
6 years ago
Victor Stinner
4a21e57fe5
bpo-40268: Remove unused structmember.h includes (GH-19530)
If only offsetof() is needed: include stddef.h instead.
When structmember.h is used, add a comment explaining that
PyMemberDef is used.
6 years ago
Victor Stinner
a15e260b70
bpo-40170: Add _PyIndex_Check() internal function (GH-19426)
Add _PyIndex_Check() function to the internal C API: fast inlined
verson of PyIndex_Check().
Add Include/internal/pycore_abstract.h header file.
Replace PyIndex_Check() with _PyIndex_Check() in C files of Objects
and Python subdirectories.
6 years ago
Dong-hee Na
87ec86c425
bpo-37207: Add _PyArg_NoKwnames() helper function (GH-18980)
6 years ago
Petr Viktorin
6e35da9763
bpo-37207: Use vectorcall for range() (GH-18464)
This continues the `range()` part of #13930 . The complete pull request is stalled on discussions around dicts, but `range()` should not be controversial. (And I plan to open PRs for other parts if this is merged.)
On top of Mark's change, I unified `range_new` and `range_vectorcall`, which had a lot of duplicate code.
https://bugs.python.org/issue37207
6 years ago
Victor Stinner
58ac700fb0
bpo-39573: Use Py_TYPE() macro in Objects directory (GH-18392)
Replace direct access to PyObject.ob_type with Py_TYPE().
6 years ago
Hai Shi
46874c26ee
bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code (GH-18254)
Moving repetitive `_Py_IDENTIFIER` instances to a global location helps identify them more easily in regards to sub-interpreter support.
6 years ago
Pablo Galindo
4b66fa6ce9
bpo-39200: Correct the error message for range() empty constructor (GH-17813)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 years ago
Jeroen Demeyer
530f506ac9
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
7 years ago
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)
22c526394b
bpo:34848 : Correct an incorrect docstring for range().index method (GH-9877)
7 years ago
Serhiy Storchaka
bb86bf4c4e
bpo-35444: Unify and optimize the helper for getting a builtin object. (GH-11047)
This speeds up pickling of some iterators.
This fixes also error handling in pickling methods when fail to
look up builtin "getattr".
7 years ago
Zackery Spytz
c9a6168924
Fix a possible crash in range.__reversed__(). (GH-10252)
7 years ago
Alexey Izbyshev
7ecae3ca0b
closes bpo-34468: Objects/rangeobject.c: Fix an always-false condition in range_repr() (GH-8880)
Also, propagate the error from PyNumber_AsSsize_t() because we don't care
only about OverflowError which is not reported if the second argument is NULL.
Reported by Svace static analyzer.
7 years ago
Siddhesh Poyarekar
55edd0c185
bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (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.
8 years ago
Serhiy Storchaka
6cca5c8459
bpo-30592: Fixed error messages for some builtins. ( #1996 )
Error messages when pass keyword arguments to some builtins that
don't support keyword arguments contained double parenthesis: "()()".
The regression was introduced by bpo-30534.
9 years ago
Serhiy Storchaka
ba85d69a3e
bpo-29878: Add global instances of int for 0 and 1. ( #852 )
9 years ago
4kir4
e46fb86118
bpo-28876: bool of large range raises OverflowError ( #699 )
9 years ago
Serhiy Storchaka
df53392f0d
Issue #28376 : Creating instances of range_iterator by calling range_iterator
type now is disallowed. Calling iter() on range instance is the only way.
Patch by Oren Milman.
9 years ago
Serhiy Storchaka
c7f490c8b1
Issue #28376 : Creating instances of range_iterator by calling range_iterator
type now is deprecated. Patch by Oren Milman.
9 years ago
Serhiy Storchaka
44759bcf13
Issue #28376 : The constructor of range_iterator now checks that step is not 0.
Patch by Oren Milman.
9 years ago
Berker Peksag
ed6224ee0c
Issue #28045 : Fix comment in range_contains_long()
Patch by wim glenn.
9 years ago
Benjamin Peterson
af580dff4a
replace PY_LONG_LONG with long long
9 years ago
Serhiy Storchaka
5d062d7ba3
Issue #27333 : Simplified testing step on 0.
10 years ago
Serhiy Storchaka
cfdfbb4d3c
Issue #27342 : Replaced some Py_XDECREFs with Py_DECREFs.
Patch by Xiang Zhang.
10 years ago
Serhiy Storchaka
6a7b3a77b4
Issue #26778 : Fixed "a/an/and" typos in code comment and documentation.
10 years ago
Serhiy Storchaka
57a01d3a0e
Issue #26200 : Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
10 years ago
Serhiy Storchaka
48842714b9
Issue #22570 : Renamed Py_SETREF to Py_XSETREF.
10 years ago
Serhiy Storchaka
4a1e70fc31
Issue #20440 : Applied yet one patch for using Py_SETREF.
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
10 years ago
Serhiy Storchaka
5a57ade58e
Issue #20440 : Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
10 years ago
Serhiy Storchaka
fa494fd883
Issue #24115 : Update uses of PyObject_IsTrue(), PyObject_Not(),
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
11 years ago
Benjamin Peterson
ac22c6b923
improved range docstring ( closes #22785 )
Patch by Ned Batchelder.
11 years ago
Serhiy Storchaka
009b811d67
Removed unintentional trailing spaces in non-external and non-generated C files.
11 years ago
Benjamin Peterson
bcf8554fd4
remove buzzword ( closes #23210 )
11 years ago
Kristján Valur Jónsson
25dded041f
Make the various iterators' "setstate" sliently and consistently clip the
index. This avoids the possibility of setting an iterator to an invalid
state.
12 years ago
Kristján Valur Jónsson
4ca688edeb
Fix pickling of rangeiter. rangeiter_setstate would not allow setting it
to the exhausted state.
12 years ago
Ezio Melotti
5792ce151c
#19067 : use imperative mood in range object docstrings. Patch by Marco Buttu.
12 years ago
Serhiy Storchaka
9594942716
Issue #18783 : Removed existing mentions of Python long type in docstrings,
error messages and comments.
13 years ago
Mark Dickinson
ffdb2c21b3
Issue #16451 : Refactor to remove duplication between range and slice in slice index computations.
13 years ago
Mark Dickinson
8cd1c7681d
Issue #16402 : In range slicing, fix shadowing of exceptions from __index__ method.
13 years ago
Chris Jerdonek
ad4b000179
Issue #14783 : Backport changes from 3.2.
13 years ago
Chris Jerdonek
83fe2e1c22
Issue #14783 : Improve int() docstring and also str(), range(), and slice().
This commit rewrites the docstring for int() to incorporate the documentation
changes made in issue #16036 . It also switches the docstrings for int(),
str(), range(), and slice() to use multi-line signatures.
13 years ago
Mark Dickinson
218a8ab5eb
Issues #16029 , #16030 : Fix pickling and repr of large xranges.
13 years ago
Antoine Pitrou
a103b96a80
Issue #14829 : Fix bisect and range() indexing with large indices (>= 2 ** 32) under 64-bit Windows.
14 years ago
Antoine Pitrou
a701388de1
Rename _PyIter_GetBuiltin to _PyObject_GetBuiltin, and do not include it in the stable ABI.
14 years ago
Kristján Valur Jónsson
31668b8f7a
Issue #14288 : Serialization support for builtin iterators.
14 years ago
Benjamin Peterson
878ce389a0
add introspection to range objects ( closes #9896 )
Patch by Daniel Urban.
14 years ago