Andy Lester
702e09fd0a
bpo-39770, array module: Remove unnecessary descriptor counting (GH-18675)
6 years ago
Dong-hee Na
1b55b65638
bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)
6 years ago
Victor Stinner
60ac6ed557
bpo-39573: Use Py_SET_SIZE() function (GH-18402)
Replace direct acccess to PyVarObject.ob_size with usage of
the Py_SET_SIZE() function.
6 years ago
Victor Stinner
d2ec81a8c9
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
6 years ago
Victor Stinner
0131aba5ae
bpo-38916: array.array: remove fromstring() and tostring() (GH-17487)
array.array: Remove tostring() and fromstring() methods. They were
aliases to tobytes() and frombytes(), deprecated since Python 3.2.
6 years ago
Marco Paolini
b44ffc8b40
bpo-38677: Fix arraymodule error handling in module initialization. (GH-17039)
6 years ago
Hai Shi
06cd5b6acd
bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)
6 years ago
Disconnect3d
13ab570feb
Remove redundant check from arraymodule b_getitem (GH-14676)
The `arraymodule`'s `b_getitem` function returns a `PyLong` converted
from `arrayobject`'s array, by dereferencing a pointer to `char`.
When the `char` type is `signed char`, the `if (x >= 128) x -= 256;` comparison/code is redundant because a `signed char` will have a value of `[-128, 127]` and so `x` will never be greater or equal than 128.
This check was indeed needed for situations where a given compiler would assume `char` being `unsigned char` which would make `x` in `[0, 256]` range.
However, the check can be removed if we cast the `ob_item` into a signed char pointer (`signed char*`) instead of `char*`.
This PR/commit introduces this change.
7 years ago
Jeroen Demeyer
59ad110d7a
bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)
7 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
Steve Dower
b82e17e626
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
7 years ago
Zackery Spytz
14514d9084
bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)
The final addition (cur += step) may overflow, so use size_t for "cur".
"cur" is always positive (even for negative steps), so it is safe to use
size_t here.
Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
7 years ago
sth
aa3ecb8041
bpo-36285: Fix integer overflow in the array module. (GH-12317)
7 years ago
Serhiy Storchaka
6a44f6eef3
bpo-36048: Use __index__() instead of __int__() for implicit conversion if available. (GH-11952)
Deprecate using the __int__() method in implicit conversions of Python
numbers to C integers.
7 years ago
Serhiy Storchaka
afb3e71a17
bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in AC. (GH-11150)
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
99d56b5356
bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033)
In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.
In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.
In addition, check if the list changed size in the loop in array_array_fromlist().
7 years ago
oldk
aa0735f597
bpo-32747: Remove trailing spaces in docstrings. (GH-5491)
8 years ago
Serhiy Storchaka
f320be77ff
bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code (GH-5222)
Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
8 years ago
Mat M
56935a53b1
bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() ( #4391 )
8 years ago
Serhiy Storchaka
b3a77964ea
bpo-27541: Reprs of subclasses of some classes now contain actual type name. ( #3631 )
Affected classes are bytearray, array, deque, defaultdict, count and repeat.
9 years ago
Adrian Wielgosik
7c17e2304b
bpo-24700: Add a fast path for comparing array.array of equal type ( #3009 )
9 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
Jim Fasarakis-Hilliard
a4095efc3f
Change error message for array methods to use 'array' instead of 'list'. ( #1853 )
9 years ago
Serhiy Storchaka
b879fe82e7
Expand the PySlice_GetIndicesEx macro. ( #1023 )
9 years ago
Sylvain
a90e64b78d
bpo-29932: Fix small error message typos in arraymodule.c (GH-888)
9 years ago
orenmn
964281af59
bpo-28298: make array 'Q', 'L' and 'I' accept big intables as elements ( #570 )
9 years ago
Serhiy Storchaka
228b12edcc
Issue #28999 : Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
9 years ago
Victor Stinner
55ba38a480
Use _PyObject_CallMethodIdObjArgs()
Issue #28915 : Replace _PyObject_CallMethodId() with
_PyObject_CallMethodIdObjArgs() in various modules when the format string was
only made of "O" formats, PyObject* arguments.
_PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and
doesn't have to parse a format string.
9 years ago
Serhiy Storchaka
460bd0d284
Issue #19569 : Compiler warnings are now emitted if use most of deprecated
functions.
9 years ago
Christian Heimes
f051e43b22
Issue #28126 : Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
10 years ago
Martin Panter
be8da9c990
Issue #27570 : Avoid zero-length memcpy() calls with null source pointers
10 years ago
Benjamin Peterson
af580dff4a
replace PY_LONG_LONG with long long
10 years ago
Benjamin Peterson
ed4aa83ff7
require a long long data type ( closes #27961 )
10 years ago
Martin Panter
996d72bccf
Issue #7063 : Remove dead code from array slice handling
Patch by Chuck.
10 years ago
Serhiy Storchaka
1a2b24f02d
Issue #27332 : Fixed the type of the first argument of module-level functions
generated by Argument Clinic. Patch by Petr Viktorin.
10 years ago
Serhiy Storchaka
9e941d6373
Fixed integer overflow in array.buffer_info().
10 years ago
Martin Panter
4c35964b76
Corrections for a/an in code comments and documentation
10 years ago
Serhiy Storchaka
ab0d198c7a
Issue #26492 : Exhausted iterator of array.array now conforms with the behavior
of iterators of other mutable sequences: it lefts exhausted even if iterated
array is extended.
10 years ago
Serhiy Storchaka
2d06e84455
Issue #25923 : Added the const qualifier to static constant arrays.
10 years ago
Serhiy Storchaka
5c4064e8bd
Issue #25421 : __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
10 years ago
Nick Coghlan
d5cacbb1d9
PEP 489: Multi-phase extension module initialization
Known limitations of the current implementation:
- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet
The leak is most visible by running:
./python -m test -R3:3 test_importlib
However, you can also see it by running:
./python -X showrefcount
Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
11 years ago
Larry Hastings
38337d1e15
Issue #24000 : Improved Argument Clinic's mapping of converters to legacy
"format units". Updated the documentation to match.
11 years ago
Larry Hastings
dbfdc380df
Issue #24001 : Argument Clinic converters now use accept={type}
instead of types={'type'} to specify the types the converter accepts.
11 years ago
Larry Hastings
7f90cba7f3
Issue #23935 : Argument Clinic's understanding of format units
accepting bytes, bytearrays, and buffers is now consistent with
both the documentation and the implementation.
11 years ago
Larry Hastings
89964c48d1
Issue #23944 : Argument Clinic now wraps long impl prototypes at column 78.
11 years ago
Serhiy Storchaka
04e6dba7dc
Fixed the array module broken in issue #23492 .
array_array_frombytes() is used in other functions, but it's signature was
changed. Closes issue #23866 .
11 years ago
Serhiy Storchaka
1009bf18b3
Issue #23501 : Argumen Clinic now generates code into separate files by default.
11 years ago
Stefan Krah
650c1e818d
Issue #14203 : Remove obsolete support for view==NULL in bytesiobuf_getbuffer()
and array_buffer_getbuf().
11 years ago
Serhiy Storchaka
b757c83ec6
Issue #22581 : Use more "bytes-like object" throughout the docs and comments.
11 years ago