summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Issue #26919: On Android, operating system data is now always encoded/decodedXavier de Gaye2016-12-151-3/+3
| | | | | | | | | | | | | | | to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8.
* | | Merge 3.6Victor Stinner2016-12-151-5/+22
|\ \ \ | |/ /
| * | Fix a memory leak in split-table dictionariesVictor Stinner2016-12-151-5/+22
| | | | | | | | | | | | | | | | | | | | | Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki.
* | | Use _PyDict_NewPresized() in _PyStack_AsDict()Victor Stinner2016-12-151-1/+1
| | | | | | | | | | | | Issue #27810.
* | | Add _PY_FASTCALL_SMALL_STACK constantVictor Stinner2016-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Fix _PyObject_CallFunctionVa(), use the small stackVictor Stinner2016-12-151-2/+1
| | | | | | | | | | | | | | | Issue #28915. Oops, I disabled the small stack to test both code paths. It's now fixed.
* | | Merge from 3.6.Serhiy Storchaka2016-12-141-28/+1
|\ \ \ | |/ /
| * | Merge from 3.6.Serhiy Storchaka2016-12-141-28/+1
| |\ \ | | |/
| | * Revert changeset 1f31bf3f76f5 (issue5322) except tests.Serhiy Storchaka2016-12-141-28/+1
| | |
* | | Issue #26110: Add LOAD_METHOD/CALL_METHOD opcodes.Yury Selivanov2016-12-141-1/+89
| | | | | | | | | | | | | | | | | | | | | 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).
* | | Issue #28820: Merge typo fixes from 3.6Martin Panter2016-12-101-1/+1
|\ \ \ | |/ /
| * | Fix typos in comment and documentationMartin Panter2016-12-101-1/+1
| | |
| * | Issue #28731: Optimize _PyDict_NewPresized() to create correct size dict.INADA Naoki2016-12-071-5/+19
| | | | | | | | | | | | Improve speed of dict literal with constant keys up to 30%.
* | | Backed out changeset 99c34e47348bVictor Stinner2016-12-091-1/+1
| | | | | | | | | | | | The change broke test_gdb.
* | | Inline PyEval_EvalFrameEx() in callersVictor Stinner2016-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The PEP 523 modified PyEval_EvalFrameEx(): it's now an indirection to interp->eval_frame(). Inline the call in performance critical code. Leave PyEval_EvalFrame() unchanged, this function is only kept for backward compatibility.
* | | Remove useless variable initializationVictor Stinner2016-12-091-9/+6
| | | | | | | | | | | | Don't initialize variables which are not used before they are assigned.
* | | Use PyObject_CallFunctionObjArgs()Victor Stinner2016-12-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace PyObject_CallFunction() with PyObject_CallFunctionObjArgs() when the format string was only made of "O" formats, PyObject* arguments. PyObject_CallFunctionObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
* | | Use _PyObject_FastCallVa() in type slotsVictor Stinner2016-12-081-81/+50
| | | | | | | | | | | | | | | Issue #28915: Replace Py_VaBuildValue()+PyObject_Call() with _PyObject_FastCallVa() to avoid the creation of temporary tuple.
* | | Add _PyObject_VaCallFunctionObjArgs() private functionVictor Stinner2016-12-081-5/+5
| | | | | | | | | | | | | | | Issue #28915: Similar to _PyObject_CallFunctionObjArgs() but use va_list to pass arguments.
* | | Use _PyObject_CallMethodIdObjArgs()Victor Stinner2016-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string only use the format 'O' for objects, like "(O)". _PyObject_CallMethodIdObjArgs() avoids the code to parse a format string and avoids the creation of a temporary tuple.
* | | _PyObject_CallFunctionVa() uses fast callVictor Stinner2016-12-081-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Use _Py_VaBuildStack() to build a C array of PyObject* and then use _PyObject_FastCall(). The function has a special case if the stack only contains one parameter and the parameter is a tuple: "unpack" the tuple of arguments in this case.
* | | Add _PyObject_CallFunctionVa() helperVictor Stinner2016-12-081-54/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Add _PyObject_CallFunctionVa() helper to factorize code of functions: * PyObject_CallFunction() * _PyObject_CallFunction_SizeT() * callmethod()
* | | Add _PyObject_FastCallVa() helperVictor Stinner2016-12-081-71/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Add _PyObject_FastCallVa() helper to factorize code of functions: * PyObject_CallFunctionObjArgs() * PyObject_CallMethodObjArgs() * _PyObject_CallMethodIdObjArgs() Inline objargs_mkstack() into _PyObject_FastCallVa(), remove objargs_mkstack().
* | | Issue #28818: Simplify lookdict functionsINADA Naoki2016-12-073-125/+97
| | |
* | | Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code.Serhiy Storchaka2016-12-071-1/+28
|\ \ \ | |/ / | | | | | | Original patch by Andreas Stührk.
| * | Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code.Serhiy Storchaka2016-12-071-1/+28
| |\ \ | | |/ | | | | | | Original patch by Andreas Stührk.
| | * Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code.Serhiy Storchaka2016-12-021-1/+28
| | | | | | | | | | | | Original patch by Andreas Stührk.
* | | _PyObject_FastCallKeywords() now calls directly tp_callVictor Stinner2016-12-061-15/+45
| | | | | | | | | | | | | | | _PyObject_FastCallKeywords() doesn't call _PyObject_FastCallDict() anymore: call directly tp_call.
* | | Fix typo in a comment of abstract.cVictor Stinner2016-12-061-1/+1
| | |
* | | Use _PyObject_CallNoArg()Victor Stinner2016-12-066-8/+8
| | | | | | | | | | | | | | | | | | | | | Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
* | | Use _PyObject_CallNoArg()Victor Stinner2016-12-062-6/+6
| | | | | | | | | | | | | | | | | | | | | Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
* | | Uniformize argument names of "call" functionsVictor Stinner2016-12-062-75/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | | Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-051-2/+16
|\ \ \ | |/ /
| * | Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-051-2/+16
| |\ \ | | |/
| | * Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.Serhiy Storchaka2016-12-051-2/+16
| | |
* | | Use directly _PyObject_GenericSetAttrWithDict()Victor Stinner2016-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Modify type_setattro() to call directly _PyObject_GenericSetAttrWithDict() instead of PyObject_GenericSetAttr(). PyObject_GenericSetAttr() is a thin wrapper to _PyObject_GenericSetAttrWithDict().
* | | Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-054-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge #23722 from 3.6Nick Coghlan2016-12-051-2/+9
|\ \ \ | |/ /
| * | Issue #23722: improve __classcell__ compatibilityNick Coghlan2016-12-051-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling zero-argument super() in __init_subclass__ and __set_name__ involved moving __class__ initialisation to type.__new__. This requires cooperation from custom metaclasses to ensure that the new __classcell__ entry is passed along appropriately. The initial implementation of that change resulted in abruptly broken zero-argument super() support in metaclasses that didn't adhere to the new requirements (such as Django's metaclass for Model definitions). The updated approach adopted here instead emits a deprecation warning for those cases, and makes them work the same way they did in Python 3.5. This patch also improves the related class machinery documentation to cover these details and to include more reader-friendly cross-references and index entries.
* | | Backed out changeset b9c9691c72c5Victor Stinner2016-12-0417-30/+40
| | | | | | | | | | | | | | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* | | Replace PyObject_CallFunction() with fastcallVictor Stinner2016-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace PyObject_CallFunction(func, "O", arg) and PyObject_CallFunction(func, "O", arg, NULL) with _PyObject_CallArg1(func, arg) Replace PyObject_CallFunction(func, NULL) with _PyObject_CallNoArg(func) _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack.
* | | Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-0117-40/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | Backed out changeset 7efddbf1aa70Victor Stinner2016-11-302-71/+68
| | |
* | | Uniformize argument names of "call" functionsVictor Stinner2016-11-292-68/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | Issue #28797: Modifying the class __dict__ inside the __set_name__ method ofSerhiy Storchaka2016-11-291-3/+11
|\ \ \ | |/ / | | | | | | | | | a descriptor that is used inside that class no longer prevents calling the __set_name__ method of other descriptors.
| * | Issue #28797: Modifying the class __dict__ inside the __set_name__ method ofSerhiy Storchaka2016-11-291-3/+11
| | | | | | | | | | | | | | | a descriptor that is used inside that class no longer prevents calling the __set_name__ method of other descriptors.
* | | Merge 3.6Victor Stinner2016-11-241-0/+9
|\ \ \ | |/ /
| * | Fix _PyGen_yf()Victor Stinner2016-11-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Issue #28782: Fix a bug in the implementation ``yield from`` when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (issue #26647). Reviewed by Serhiy Storchaka and Yury Selivanov.
* | | Issue #28774: Simplified encoding a str result of an error handler in ASCIISerhiy Storchaka2016-11-231-26/+12
| | | | | | | | | | | | and Latin1 encoders.
* | | Issue #28774: Fix start/end pos in unicode_encode_ucs1().Xiang Zhang2016-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | Fix error position of the unicode error in ASCII and Latin1 encoders when a string returned by the error handler contains multiple non-encodable characters (non-ASCII for the ASCII codec, characters out of the U+0000-U+00FF range for Latin1).