summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Use _PyObject_CallMethodIdObjArgs()Victor Stinner2016-12-081-1/+1
| | | | | | | | | 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.
* Add _Py_VaBuildStack() functionVictor Stinner2016-12-081-0/+98
| | | | | Issue #28915: Similar to Py_VaBuildValue(), but work on a C array of PyObject*, instead of creating a tuple.
* modsupport: replace int with Py_ssize_tVictor Stinner2016-12-081-8/+8
| | | | | | | | Issue #28915: Py_ssize_t type is better for indexes. The compiler might emit more efficient code for i++. Py_ssize_t is the type of a PyTuple index for example. Replace also "int endchar" with "char endchar".
* modsupport: replace int with Py_ssize_tVictor Stinner2016-12-081-17/+20
| | | | Issue #28915.
* Use _PyObject_CallNoArg()Victor Stinner2016-12-063-4/+4
| | | | | | | Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
* Use _PyObject_CallNoArg()Victor Stinner2016-12-061-2/+2
| | | | | | | Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
* Uniformize argument names of "call" functionsVictor Stinner2016-12-062-7/+8
| | | | | | | | | | | | 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 #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-054-4/+4
| | | | | | | | | | | 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-053-1184/+1218
|\
| * Issue #23722: improve __classcell__ compatibilityNick Coghlan2016-12-053-1184/+1218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-045-10/+10
| | | | | | | | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* | Add sys.getandroidapilevel()Victor Stinner2016-12-021-0/+18
| | | | | | | | | | | | | | Issue #28740: Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android.
* | Replace PyObject_CallFunction() with fastcallVictor Stinner2016-12-013-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | WITH_CLEANUP_START uses fastcallVictor Stinner2016-12-011-3/+10
| | | | | | | | | | Modify WITH_CLEANUP_START bytecode: replace PyObject_CallFunctionObjArgs() with _PyObject_FastCall().
* | Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-015-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Issue #28823: Simplified compiling with opcode BUILD_MAP_UNPACK.Serhiy Storchaka2016-11-281-5/+2
| |
* | call_function(): document PyMethod optimizationVictor Stinner2016-11-281-1/+5
| |
* | Remove CALL_PROFILE special buildVictor Stinner2016-11-282-92/+14
| | | | | | | | | | | | | | | | | | | | | | 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 #12844: More than 255 arguments can now be passed to a function.Serhiy Storchaka2016-11-281-5/+0
| |
* | Merge 3.6Victor Stinner2016-11-241-0/+1
|\ \ | |/
| * Fix _PyGen_yf()Victor Stinner2016-11-241-0/+1
| | | | | | | | | | | | | | | | 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.
* | mergeRaymond Hettinger2016-11-221-1/+3
|\ \ | |/
| * Issue #27100: Fix ref leakRaymond Hettinger2016-11-221-1/+3
| |
* | mergeRaymond Hettinger2016-11-221-4/+4
|\ \ | |/
| * Issue #27100: With statement reports missing __enter__ before __exit__. ↵Raymond Hettinger2016-11-221-4/+4
| | | | | | | | (Contributed by Jonathan Ellington.)
* | Issue #28748: Private variable _Py_PackageContext is now of type "const char *"Serhiy Storchaka2016-11-212-2/+2
| | | | | | | | rather of "char *".
* | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-203-15/+14
| | | | | | | | functions.
* | Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-2010-26/+26
| | | | | | | | UTF-8 represenatation of Unicode objects.
* | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-207-16/+16
|\ \ | |/ | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
| * Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-207-16/+16
| | | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
* | Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka2016-11-202-3/+9
|\ \ | |/
| * Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka2016-11-202-3/+9
| |\
| | * Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka2016-11-202-3/+9
| | |
* | | Issue #28746: Merge 3.6Xavier de Gaye2016-11-191-1/+1
|\ \ \ | |/ /
| * | Issue #28746: Fix the set_inheritable() file descriptor method on platformsXavier de Gaye2016-11-191-1/+1
| | | | | | | | | | | | that do not have the ioctl FIOCLEX and FIONCLEX commands
* | | Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-162-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
| * | Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-162-2/+2
| |\ \ | | |/ | | | | | | | | | | | | The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
| | * Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-162-2/+2
| | | | | | | | | | | | | | | | | | The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
* | | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-167-33/+27
|\ \ \ | |/ / | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-167-33/+27
| |\ \ | | |/ | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| | * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-167-31/+25
| | | | | | | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | | Issue #26920: Merge 3.6Xavier de Gaye2016-11-161-1/+1
|\ \ \ | |/ /
| * | Issue #26920: Fix not getting the locale's charset upon initializing the ↵Xavier de Gaye2016-11-161-1/+1
| | | | | | | | | | | | | | | | | | interpreter, on platforms that do not have langinfo
* | | Merge 3.6Victor Stinner2016-11-151-1/+7
|\ \ \ | |/ /
| * | Fix warn_invalid_escape_sequence()Victor Stinner2016-11-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Issue #28691: Fix warn_invalid_escape_sequence(): handle correctly DeprecationWarning raised as an exception. First clear the current exception to replace the DeprecationWarning exception with a SyntaxError exception. Unit test written by Serhiy Storchaka.
* | | Issue #28676: merge from 3.6Ned Deily2016-11-121-2/+3
|\ \ \ | |/ /
| * | Issue #28676: merge from 3.5Ned Deily2016-11-121-2/+3
| |\ \ | | |/
| | * Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.Ned Deily2016-11-121-2/+3
| | | | | | | | | | | | Patch by Gareth Rees.
| * | Issue #28665: Harmonize STORE_DEREF with STORE_FAST and LOAD_DEREF giving a ↵Raymond Hettinger2016-11-111-2/+3
| | | | | | | | | | | | 40% speedup.
* | | Issue #28665: Use macro form of PyCell_GET/SETRaymond Hettinger2016-11-121-4/+8
| | |