summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Fix grammar in doc string, RST markupMartin Panter2017-01-242-4/+4
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-4/+2
| | | | possible but Coccinelle couldn't find opportunity.
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-239-51/+25
| | | | possible. Patch is writen with Coccinelle.
* Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()Serhiy Storchaka2017-01-222-6/+6
| | | | is now of type "const char *" rather of "char *".
* Issue #29331: Simplified argument parsing in sorted() and list.sort().Serhiy Storchaka2017-01-211-15/+15
|
* Issue #29289: Argument Clinic generates reasonable name for the parameter ↵Serhiy Storchaka2017-01-192-14/+14
| | | | "default".
* Issue #29311: Argument Clinic generates reasonable name for the parameter ↵Serhiy Storchaka2017-01-192-17/+19
| | | | "default".
* Issue #20186: Converted builtins enumerate() and reversed() to Argument Clinic.Serhiy Storchaka2017-01-192-39/+121
| | | | Patch by Tal Einat.
* Add a note explaining why dict_update() doesn't use METH_FASTCALLVictor Stinner2017-01-191-0/+3
| | | | Issue #29312.
* dict.get() and dict.setdefault() now use ACVictor Stinner2017-01-192-25/+98
| | | | | | | | | | | Issue #29311: dict.get() and dict.setdefault() methods now use Argument Clinic to parse arguments. Their calling convention changes from METH_VARARGS to METH_FASTCALL which avoids the creation of a temporary tuple. The signature of docstrings is also enhanced. For example, get(...) becomes: get(self, key, default=None, /)
* _PyStack_AsDict() now checks kwnames != NULLVictor Stinner2017-01-181-1/+3
| | | | Issue #29259.
* Cleanup _PyMethodDef_RawFastCallDict()Victor Stinner2017-01-181-11/+9
| | | | | | Issue #29259: use a different case for METH_VARARGS and METH_VARARGS|METH_KEYWORDS to avoid testing again flags to decide if keywords should be checked or not.
* Rephrase !PyErr_Occurred() comment: may=>canVictor Stinner2017-01-184-6/+6
| | | | Issue #29259.
* _PyObject_FastCallKeywords() now checks !PyErr_Occurred()Victor Stinner2017-01-181-0/+5
| | | | | Issue #29259. All other functions calling functions start with the similar assertion.
* PyCFunction_Call() now calls _PyCFunction_FastCallDict()Victor Stinner2017-01-181-70/+5
| | | | | | | | | | Issue #29259. We had 3 versions of similar code: * PyCFunction_Call() * _PyCFunction_FastCallDict() * _PyCFunction_FastCallKeywords() PyCFunction_Call() now calls _PyCFunction_FastCallDict() to factorize the code.
* Fix _PyMethodDef_RawFastCallDict() argument parsingVictor Stinner2017-01-181-14/+16
| | | | | | | | | Issue #29259: * Move also the !PyErr_Occurred() assertion to the top, similar to other functions. * Fix also comment/error messages: the function was renamed to _PyMethodDef_RawFastCallDict()
* _PyObject_FastCallKeywords() now checks the resultVictor Stinner2017-01-181-0/+2
| | | | Issue ##27830, Issue #29259.
* Optimize methoddescr_call(): avoid temporary PyCFunctionVictor Stinner2017-01-182-26/+33
| | | | | | 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-182-3/+2
| | | | Issue #29259.
* Convert some OrderedDict methods to Argument ClinicVictor Stinner2017-01-172-87/+219
| | | | | | | | | Issue #29289. Convert methods: * fromkeys() class method * setdefault() * popitem() * move_to_end()
* Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-175-37/+77
| | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code.
* Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-173-39/+87
| | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using only positional arguments.
* _PyStack_UnpackDict() now returns -1 on errorVictor Stinner2017-01-172-9/+11
| | | | | Issue #29286. Change _PyStack_UnpackDict() prototype to be able to notify of failure when args is NULL.
* Rename _PyArg_ParseStack to _PyArg_ParseStackAndKeywordsVictor Stinner2017-01-174-16/+16
| | | | Issue #29286.
* type_prepare() now uses fast call (METH_FASTCALL)Victor Stinner2017-01-161-2/+3
|
* Add _PyStack_AsTupleSlice() helperVictor Stinner2017-01-161-0/+23
|
* Optimize _PyCFunction_FastCallKeywords()Victor Stinner2017-01-161-36/+131
| | | | | | | | | | | | | | Issue #29259: Write fast path in _PyCFunction_FastCallKeywords() for METH_FASTCALL, avoid the creation of a temporary dictionary for keyword arguments. Cleanup also _PyCFunction_FastCallDict(): * Don't dereference func before checking that it's not NULL * Move code to raise the "no keyword argument" exception into a new no_keyword_error label. Update python-gdb.py for the change.
* Issue #20180: forgot to update AC output.INADA Naoki2017-01-162-41/+39
|
* Issue #20180: convert unicode methods to AC.INADA Naoki2017-01-162-409/+1405
|
* Merge doc fixes from 3.6Martin Panter2017-01-141-1/+1
|\
| * Merge doc fixes from 3.5Martin Panter2017-01-141-1/+1
| |\
| | * Fix grammar, typos and markup in documentation and code commentsMartin Panter2017-01-141-1/+1
| | | | | | | | | | | | | | | | | | * Indent versionchanged at method level, not class level * Mark up ``--help`` to avoid generating an en dash * Use forward slash in Unix command line with a dollar sign ($) prompt
* | | Issue #1621: Overflow should not be possible in listextend()Martin Panter2017-01-141-0/+3
| | |
* | | Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-8/+23
|\ \ \ | |/ / | | | | | | | | | KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
| * | Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-8/+23
| |\ \ | | |/ | | | | | | | | | KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
| | * Issue #28969: Fixed race condition in C implementation of functools.lru_cache.Serhiy Storchaka2017-01-121-8/+23
| | | | | | | | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-102-44/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Issue #29145: Merge 3.6.Xiang Zhang2017-01-102-7/+9
|\ \ \ | |/ /
| * | Issue #29145: Merge 3.5.Xiang Zhang2017-01-101-6/+8
| |\ \ | | |/
| | * Issue #29145: Fix overflow checks in str.replace() and str.join().Xiang Zhang2017-01-101-6/+8
| | | | | | | | | | | | Based on patch by Martin Panter.
* | | Merge 3.6INADA Naoki2017-01-062-17/+25
|\ \ \ | |/ /
| * | Issue #29159: Fix regression in bytes(x) when x.__index__() raises Exception.INADA Naoki2017-01-062-17/+25
| | |
* | | Issue #28839: Optimize function_call()Victor Stinner2017-01-031-47/+6
| | | | | | | | | | | | | | | | | | | | | function_call() now simply calls _PyFunction_FastCallDict(). _PyFunction_FastCallDict() is more efficient: it contains fast paths for the common case (optimized code object and no keyword argument).
* | | Merge 3.6.Stefan Krah2016-12-301-1/+1
|\ \ \ | |/ /
| * | Merge 3.5.Stefan Krah2016-12-301-1/+1
| |\ \ | | |/
| | * Issue #29111: Fix memoryview signature.Stefan Krah2016-12-301-1/+1
| | |
| | * Issue #29073: bytearray formatting no longer truncates on first null byte.Serhiy Storchaka2016-12-281-1/+3
| | |
* | | Issue #28427: old keys should not remove new values fromAntoine Pitrou2016-12-271-16/+74
|\ \ \ | |/ / | | | | | | WeakValueDictionary when collecting from another thread.
| * | Issue #28427: old keys should not remove new values fromAntoine Pitrou2016-12-271-17/+74
| |\ \ | | |/ | | | | | | WeakValueDictionary when collecting from another thread.