summaryrefslogtreecommitdiff
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Issue #29157: enhance py_getrandom() documentationVictor Stinner2017-01-061-13/+20
|
* py_getentropy() now supports ENOSYS, EPERM & EINTRVictor Stinner2017-01-061-3/+39
| | | | Issue #29157.
* Issue #29157: getrandom() is now preferred over getentropy()Victor Stinner2017-01-061-44/+47
| | | | | | | | | | | | | | The glibc now implements getentropy() on Linux using the getrandom() syscall. But getentropy() doesn't support non-blocking mode. Since getrandom() is tried first, it's not more needed to explicitly exclude getentropy() on Solaris. Replace: if defined(HAVE_GETENTROPY) && !defined(sun) with if defined(HAVE_GETENTROPY)
* Issue #29157: Simplify dev_urandom()Victor Stinner2017-01-061-29/+87
| | | | | | pyurandom() is now responsible to call getentropy() or getrandom(). Enhance also dev_urandom() and pyurandom() documentation.
* Issue #29157: dev_urandom() now calls py_getentropy()Victor Stinner2017-01-061-20/+16
| | | | | Prepare the fallback to support getentropy() failure and falls back on reading from /dev/urandom.
* Optimize _PyFunction_FastCallDict() when kwargs is {}Victor Stinner2017-01-031-3/+5
| | | | | Issue #28839: Optimize _PyFunction_FastCallDict() when kwargs is an empty dictionary, avoid the creation of an useless empty tuple.
* merge 3.6 (#29057)Benjamin Peterson2017-01-011-1/+1
|\
| * merge 3.5 (#29057)Benjamin Peterson2017-01-011-1/+1
| |\
| | * only include sys/random.h if it seems like it might have something useful ↵Benjamin Peterson2017-01-011-1/+1
| | | | | | | | | | | | (#29057)
* | | merge 3.6Benjamin Peterson2017-01-011-1/+1
|\ \ \ | |/ /
| * | merge 3.5Benjamin Peterson2017-01-011-1/+1
| |\ \ | | |/
| | * merge 3.4Benjamin Peterson2017-01-011-1/+1
| | |\
| | | * merge 3.3Benjamin Peterson2017-01-011-1/+1
| | | |\
| | | | * ring in 2017 for PythonBenjamin Peterson2017-01-011-1/+1
| | | | |
* | | | | Issue #29049: Remove unnecessary Py_DECREFINADA Naoki2016-12-261-1/+1
| | | | |
* | | | | Issue #29049: Fix refleak introduced by f5eb0c4f5d37.INADA Naoki2016-12-261-1/+4
| | | | |
* | | | | Issue #29049: Call _PyObject_GC_TRACK() lazily when calling Python function.INADA Naoki2016-12-241-10/+21
| | | | | | | | | | | | | | | | | | | | Calling function is up to 5% faster.
* | | | | merge 3.6 (#28932)Benjamin Peterson2016-12-191-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | merge 3.5 (#28932)Benjamin Peterson2016-12-191-1/+1
| |\ \ \ \ | | |/ / /
| | * | | add a specific configure check for sys/random.h (closes #28932)Benjamin Peterson2016-12-191-1/+1
| | | | |
* | | | | Issue #25677: Merge SyntaxError caret positioning from 3.6Martin Panter2016-12-192-5/+2
|\ \ \ \ \ | |/ / / /
| * | | | Issue #25677: Merge SyntaxError caret positioning from 3.5Martin Panter2016-12-192-5/+2
| |\ \ \ \ | | |/ / /
| | * | | Issue #25677: Correct syntax error caret for indented blocks.Martin Panter2016-12-112-5/+2
| | | | | | | | | | | | | | | | | | | | Based on patch by Michael Layzell.
* | | | | Issue #18896: Python function can now have more than 255 parameters.Serhiy Storchaka2016-12-162-6/+1
| | | | | | | | | | | | | | | | | | | | 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-163-22/+14
| | | | | | | | | | | | | | | | | | | | dict.
* | | | | Merge 3.6.Xavier de Gaye2016-12-151-5/+5
|\ \ \ \ \ | |/ / / /
| * | | | Issue #26919: On Android, operating system data is now always encoded/decodedXavier de Gaye2016-12-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8.
* | | | | Add _PY_FASTCALL_SMALL_STACK constantVictor Stinner2016-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #26110: Add LOAD_METHOD/CALL_METHOD opcodes.Yury Selivanov2016-12-135-481/+615
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #28896: Disable WindowsRegistryFinder by default.Steve Dower2016-12-121-56/+53
|\ \ \ \ \ | |/ / / /
| * | | | Issue #28896: Disable WindowsRegistryFinder by default.Steve Dower2016-12-121-56/+53
| | | | |
* | | | | Issue #28739: f-string expressions no longer accepted as docstrings andSerhiy Storchaka2016-12-112-7/+7
|\ \ \ \ \ | |/ / / / | | | | | | | | | | by ast.literal_eval() even if they do not include subexpressions.
| * | | | Issue #28739: f-string expressions no longer accepted as docstrings andSerhiy Storchaka2016-12-112-7/+7
| | | | | | | | | | | | | | | | | | | | by ast.literal_eval() even if they do not include subexpressions.
* | | | | Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-8/+4
|\ \ \ \ \ | |/ / / / | | | | | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
| * | | | Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-8/+4
| |\ \ \ \ | | |/ / / | | | | | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
| | * | | Issue #28512: Fixed setting the offset attribute of SyntaxError bySerhiy Storchaka2016-12-111-8/+4
| | | | | | | | | | | | | | | | | | | | PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
* | | | | Backed out changeset 99c34e47348bVictor Stinner2016-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | The change broke test_gdb.
* | | | | Issue #20185: Convert _warnings.warn() to Argument ClinicVictor Stinner2016-12-092-16/+59
| | | | | | | | | | | | | | | | | | | | Fix warn_explicit(): interpret source=None as source=NULL.
* | | | | Inline PyEval_EvalFrameEx() in callersVictor Stinner2016-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Use _PyObject_CallMethodIdObjArgs()Victor Stinner2016-12-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Use _PyObject_CallMethodIdObjArgs()Victor Stinner2016-12-091-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-091-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-091-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-091-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.