summaryrefslogtreecommitdiff
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Issue #29460: _PyArg_NoKeywords(), _PyArg_NoStackKeywords() andSerhiy Storchaka2017-02-061-0/+7
| | | | _PyArg_NoPositional() now are macros.
* Issue #27867: Silenced may-be-used-uninitialized warnings afterSerhiy Storchaka2017-02-0420-1094/+915
|\ | | | | | | using PySlice_GetIndicesEx() in debug builds.
| * Issue #29263: LOAD_METHOD support for C methodsINADA Naoki2017-02-032-0/+10
| | | | | | | | Calling builtin method is at most 10% faster.
| * Issue #27867: Function PySlice_GetIndicesEx() is deprecated and replaced withSerhiy Storchaka2017-01-2520-1094/+905
| |\ | | | | | | | | | | | | | | | a macro if Py_LIMITED_API is not set or set to the value between 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher. Added functions PySlice_Unpack() and PySlice_AdjustIndices().
| | * Issue #29083: Fixed the declaration of some public API functions.Serhiy Storchaka2017-01-2419-1093/+904
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and Py_BuildValue() were not available in limited API of version < 3.3 when PY_SSIZE_T_CLEAN is defined.
| | | * Issue #29360: _PyStack_AsDict() doesn't check kwnamesVictor Stinner2017-01-241-6/+9
| | | | | | | | | | | | | | | | | | | | Remove two assertions which can fail on legit code. Keyword arguments are checked later with better tests and raise a regular (TypeError) exception.
| | | * Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-6/+3
| | | | | | | | | | | | | | | | possible but Coccinelle couldn't find opportunity.
| | | * Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()Serhiy Storchaka2017-01-221-2/+2
| | | | | | | | | | | | | | | | is now of type "const char *" rather of "char *".
| | | * Optimize methoddescr_call(): avoid temporary PyCFunctionVictor Stinner2017-01-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Issue #29259, #29263. methoddescr_call() creates a PyCFunction object, call it and the destroy it. Add a new _PyMethodDef_RawFastCallDict() method to avoid the temporary PyCFunction object.
| | | * Remove unused func parameter of _PyStack_UnpackDict()Victor Stinner2017-01-181-2/+1
| | | | | | | | | | | | | | | | Issue #29259.
| | | * Add _PyArg_UnpackStack() function helperVictor Stinner2017-01-171-0/+10
| | | | | | | | | | | | | | | | Issue #29286.
| | | * _PyStack_UnpackDict() now returns -1 on errorVictor Stinner2017-01-171-5/+8
| | | | | | | | | | | | | | | | | | | | Issue #29286. Change _PyStack_UnpackDict() prototype to be able to notify of failure when args is NULL.
| | | * Add _PyArg_NoStackKeywords() helper functionVictor Stinner2017-01-171-1/+2
| | | | | | | | | | | | | | | | | | | | Issue #29286. Similar to _PyArg_NoKeywords(), but expects a tuple of keyword names, instead of a dict.
| | | * Add _PyArg_ParseStack() helper functionVictor Stinner2017-01-171-3/+13
| | | | | | | | | | | | | | | | | | | | Issue #29286. Function similar to PyArg_ParseTuple(), but uses a C array of PyObject* to pass arguments. Don't support the compatibility mode.
| | | * Rename _PyArg_ParseStack to _PyArg_ParseStackAndKeywordsVictor Stinner2017-01-172-4/+4
| | | | | | | | | | | | | | | | Issue #29286.
| | | * Add _PyStack_AsTupleSlice() helperVictor Stinner2017-01-161-0/+6
| | | |
| | | * Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-0/+1
| | | |\ | | | | | | | | | | | | | | | | | | | | KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
| | | * | Disable _PyStack_AsTuple() inliningVictor Stinner2017-01-111-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29234: Inlining _PyStack_AsTuple() into callers increases their stack consumption, Disable inlining to optimize the stack consumption. Add _Py_NO_INLINE: use __attribute__((noinline)) of GCC and Clang. It reduces the stack consumption, bytes per call, before => after: test_python_call: 1040 => 976 (-64 B) test_python_getitem: 976 => 912 (-64 B) test_python_iterator: 1120 => 1056 (-64 B) => total: 3136 => 2944 (- 192 B)
| | | * | call_method() now uses _PyObject_FastCall()Victor Stinner2017-01-111-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #29233: Replace the inefficient _PyObject_VaCallFunctionObjArgs() with _PyObject_FastCall() in call_method() and call_maybe(). Only a few functions call call_method() and call it with a fixed number of arguments. Avoid the complex and expensive _PyObject_VaCallFunctionObjArgs() function, replace it with an array allocated on the stack with the exact number of argumlents. It reduces the stack consumption, bytes per call, before => after: test_python_call: 1168 => 1152 (-16 B) test_python_getitem: 1344 => 1008 (-336 B) test_python_iterator: 1568 => 1232 (-336 B) Remove the _PyObject_VaCallFunctionObjArgs() function which became useless. Rename it to object_vacall() and make it private.
| | | * | Merge 3.6Victor Stinner2017-01-0517-1081/+851
| | | |\ \
| | | | * | Issue #28915: Exclude _Py_VaBuildStack from the limited API.Serhiy Storchaka2016-12-271-0/+4
| | | | | |
| | | | * | Issue #28427: old keys should not remove new values fromAntoine Pitrou2016-12-2717-1081/+847
| | | | |\ \ | | | | | | | | | | | | | | | | | | | | | WeakValueDictionary when collecting from another thread.
| | | | | * \ Issue #29058: All stable API extensions added after Python 3.2 are nowSerhiy Storchaka2016-12-2717-1081/+847
| | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API.
| | | | | | * | Issue #29049: Call _PyObject_GC_TRACK() lazily when calling Python function.INADA Naoki2016-12-241-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling function is up to 5% faster.
| | | | | | * | abstract.h: remove long outdated commentVictor Stinner2016-12-191-118/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28838: The documentation is of the Python C API is more complete and more up to date than this old comment. Removal suggested by Antoine Pitrou.
| | | | | | * | Issue #29009: Merge 3.6.Xiang Zhang2016-12-1916-979/+857
| | | | | | |\ \
| | | | | | | * | Issue #18896: Python function can now have more than 255 parameters.Serhiy Storchaka2016-12-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | collections.namedtuple() now supports tuples with more than 255 elements.
| | | | | | | * | Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of ↵Serhiy Storchaka2016-12-162-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dict.
| | | | | | | * | Add _PY_FASTCALL_SMALL_STACK constantVictor Stinner2016-12-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28870: Add a new _PY_FASTCALL_SMALL_STACK constant, size of "small stacks" allocated on the C stack to pass positional arguments to _PyObject_FastCall(). _PyObject_Call_Prepend() now uses a small stack of 5 arguments (40 bytes) instead of 8 (64 bytes), since it is modified to use _PY_FASTCALL_SMALL_STACK.
| | | | | | | * | Issue #28838: Cleanup abstract.hVictor Stinner2016-12-151-621/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite all comments to use the same style than other Python header files: comment functions *before* their declaration, no newline between the comment and the declaration. Reformat some comments, add newlines, to make them easier to read. Quote argument like 'arg' to mention an argument in a comment.
| | | | | | | * | Issue #26110: Add LOAD_METHOD/CALL_METHOD opcodes.Yury Selivanov2016-12-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Special thanks to INADA Naoki for pushing the patch through the last mile, Serhiy Storchaka for reviewing the code, and to Victor Stinner for suggesting the idea (originally implemented in the PyPy project).
| | | | | | | * | Add _PyObject_VaCallFunctionObjArgs() private functionVictor Stinner2016-12-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Similar to _PyObject_CallFunctionObjArgs() but use va_list to pass arguments.
| | | | | | | * | Add _Py_VaBuildStack() functionVictor Stinner2016-12-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Similar to Py_VaBuildValue(), but work on a C array of PyObject*, instead of creating a tuple.
| | | | | | | * | merge 3.6 (#28898)Benjamin Peterson2016-12-071-2/+3
| | | | | | | |\ \
| | | | | | | * | | Issue #28838: Fix weird indentation of abstract.hVictor Stinner2016-12-061-847/+859
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove most indentation to move code at the left.
| | | | | | | * | | Uniformize argument names of "call" functionsVictor Stinner2016-12-062-70/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28838: Rename parameters of the "calls" functions of the Python C API. * Rename 'callable_object' and 'func' to 'callable': any Python callable object is accepted, not only Python functions * Rename 'method' and 'nameid' to 'name' (method name) * Rename 'o' to 'obj' * Move, fix and update documentation of PyObject_CallXXX() functions in abstract.h * Update also the documentaton of the C API (update parameter names)
| | | | | | | * | | Fixed misplaced comment.Serhiy Storchaka2016-12-0612-67/+94
| | | | | | | |\ \ \
| | | | | | | | * \ \ Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-061-1/+1
| | | | | | | | |\ \ \
| | | | | | | | * | | | Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace _PyObject_CallArg1(func, arg) with PyObject_CallFunctionObjArgs(func, arg, NULL) Using the _PyObject_CallArg1() macro increases the usage of the C stack, which was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this issue.
| | | | | | | | * | | | fix _PyObject_CallArg1 compiler warnings (closes #28855)Benjamin Peterson2016-12-011-1/+1
| | | | | | | | | | | |
| | | | | | | | * | | | Backed out changeset 7efddbf1aa70Victor Stinner2016-11-302-22/+22
| | | | | | | | | | | |
| | | | | | | | * | | | Uniformize argument names of "call" functionsVictor Stinner2016-11-292-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Callable object: callable, o, callable_object => func * Object for method calls: o => obj * Method name: name or nameid => method Cleanup also the C code: * Don't initialize variables to NULL if they are not used before their first assignement * Add braces for readability
| | | | | | | | * | | | Remove CALL_PROFILE special buildVictor Stinner2016-11-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28799: * Remove the PyEval_GetCallStats() function. * Deprecate the untested and undocumented sys.callstats() function. * Remove the CALL_PROFILE special build Use the sys.setprofile() function, cProfile or profile module to profile function calls.
| | | | | | | | * | | | Issue #28761: The fields name and doc of structures PyMemberDef, PyGetSetDef,Serhiy Storchaka2016-11-223-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of type "const char *" rather of "char *".
| | | | | | | | * | | | MergeRaymond Hettinger2016-11-219-52/+83
| | | | | | | | |\ \ \ \
| | | | | | | | | * | | | Issue #28748: Private variable _Py_PackageContext is now of type "const char *"Serhiy Storchaka2016-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather of "char *".
| | | | | | | | | * | | | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-206-45/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions.
| | | | | | | | | * | | | Issue #28701: _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString nowSerhiy Storchaka2016-11-162-6/+29
| | | | | | | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | require ASCII right argument and assert this condition in debug build.
| | | | | | | | | | * \ \ \ Issue #21449: Removed private function _PyUnicode_CompareWithId.Serhiy Storchaka2016-11-162-6/+29
| | | | | | | | | | |\ \ \ \
| | | | | | | | | | | * \ \ \ Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-162-6/+29
| | | | | | | | | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.