summaryrefslogtreecommitdiff
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38310: Predict BUILD_MAP_UNPACK_WITH_CALL -> CALL_FUNCTION_EX. (GH-16467)Brandt Bucher2019-09-281-0/+2
|
* bpo-37151: remove special case for PyCFunction from PyObject_Call (GH-14684)Jeroen Demeyer2019-09-111-1/+1
| | | | | | | bpo-37151: remove special case for PyCFunction from PyObject_Call Alse, make the undocumented function PyCFunction_Call an alias of PyObject_Call and deprecate it.
* bpo-38090: Fix reference leak in ceval.c (GH-15848)Pablo Galindo2019-09-101-1/+0
|
* bpo-20490: Improve circular import error message (GH-15308)Anthony Sottile2019-09-091-4/+11
|
* bpo-15088 : Remove PyGen_NeedsFinalizing() (GH-15702)Joannah Nanjekye2019-09-061-5/+0
| | | | | Remove PyGen_NeedsFinalizing(): it was not documented, tested or used anywhere within CPython after the implementation of PEP 442.
* bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)Zackery Spytz2019-08-251-0/+7
| | | | Fix assert statement misbehavior if AssertionError is shadowed.
* bpo-37540: vectorcall: keyword names must be strings (GH-14682)Jeroen Demeyer2019-08-161-15/+9
| | | | | | | | The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not. CC @markshannon @vstinner https://bugs.python.org/issue37540
* bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)Jeroen Demeyer2019-07-111-1/+1
|
* bpo-36974: separate vectorcall functions for each calling convention (GH-13781)Jeroen Demeyer2019-07-051-4/+4
|
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-1/+1
|
* bpo-37484: use _PyObject_Vectorcall for __exit__ (GH-14557)Jeroen Demeyer2019-07-031-5/+3
|
* bpo-35224: Reverse evaluation order of key: value in dict comprehensions ↵Jörn Heissler2019-06-221-2/+2
| | | | | | | | | | | (GH-14139) … as proposed in PEP 572; key is now evaluated before value. https://bugs.python.org/issue35224
* bpo-37151: remove _PyCFunction_FastCallDict (GH-14269)Jeroen Demeyer2019-06-211-4/+4
|
* bpo-37249: add declaration of _PyObject_GetMethod (GH-14015)Jeroen Demeyer2019-06-141-4/+0
|
* bpo-36710: Pass explicitly tstate in sysmodule.c (GH-14060)Victor Stinner2019-06-131-2/+1
| | | | | | | | * Replace global var Py_VerboseFlag with interp->config.verbose. * Add _PyErr_NoMemory(tstate) function. * Add tstate parameter to _PyEval_SetCoroutineOriginTrackingDepth() and move the function to the internal API. * Replace _PySys_InitMain(runtime, interp) with _PySys_InitMain(runtime, tstate).
* Revert "bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)" (GH-13795)Victor Stinner2019-06-041-15/+11
| | | This reverts commit 396e0a8d9dc65453cb9d53500d0a620602656cfe.
* bpo-37146: disable opcache when Py_DEBUG is defined (GH-13787)Inada Naoki2019-06-041-0/+7
| | | | | --with-pydebug is commonly used to find memory leaks. But opcache makes it harder. So disable opcache when Py_DEBUG is defined.
* Revert "bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-06-031-205/+130
| | | | | _Py_AddPendingCall(). (gh-13714)" (GH-13780) This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
* bpo-26219: remove unused code (GH-13775)Inada Naoki2019-06-031-3/+0
| | | | This code was for deoptimization, which is removed from PR-12884.
* bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884)Inada Naoki2019-06-031-1/+142
| | | | | | This patch implements per opcode cache mechanism, and use it in only LOAD_GLOBAL opcode. Based on Yury's opcache3.patch in bpo-26219.
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-06-011-131/+205
| | | | (gh-13714)
* bpo-37122: Make co->co_argcount represent the total number of positonal ↵Pablo Galindo2019-06-011-31/+15
| | | | arguments in the code object (GH-13726)
* bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)Eric Snow2019-05-311-11/+15
| | | https://bugs.python.org/issue36818
* bpo-36974: rename _FastCallKeywords -> _Vectorcall (GH-13653)Jeroen Demeyer2019-05-301-4/+4
|
* bpo-36974: implement PEP 590 (GH-13185)Jeroen Demeyer2019-05-291-55/+37
| | | | | Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be> Co-authored-by: Mark Shannon <mark@hotpy.org>
* bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) ↵Matthias Bussonnier2019-05-281-39/+0
| | | | | | | | | | (GH-13577) It has been documented as deprecated and to be removed in 3.8; From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`. https://bugs.python.org/issue36933
* bpo-36710: Add tstate parameter in ceval.c (GH-13547)Victor Stinner2019-05-241-346/+386
| | | | | | | | | | | | | | | | * Fix a possible reference leak in _PyErr_Print() if exception is NULL. * PyErr_BadInternalCall(): replace PyErr_Format() with _PyErr_SetString(). * Add pycore_pyerrors.h header file. * New functions: * _PyErr_Clear() * _PyErr_Fetch() * _PyErr_Print() * _PyErr_Restore() * _PyErr_SetObject() * _PyErr_SetString() * Add 'tstate' parameter to _PyEval_AddPendingCall().
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+23
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36728: Remove PyEval_ReInitThreads() from C API (GH-13241)Victor Stinner2019-05-131-2/+1
| | | | | | | | Remove the PyEval_ReInitThreads() function from the Python C API. It should not be called explicitly: use PyOS_AfterFork_Child() instead. Rename PyEval_ReInitThreads() to _PyEval_ReInitThreads() and add a 'runtime' parameter.
* bpo-36710: Add 'ceval' local variable to ceval.c (GH-12934)Victor Stinner2019-05-101-165/+204
| | | | | | | | | | | | | | | | | | | | | | | | | Add "struct _ceval_runtime_state *ceval = &_PyRuntime.ceval;" local variables to function to better highlight the dependency on the global variable _PyRuntime and to point directly to _PyRuntime.ceval field rather than on the larger _PyRuntime. Changes: * Add _PyRuntimeState_GetThreadState(runtime) macro. * Add _PyEval_AddPendingCall(ceval, ...) and _PyThreadState_Swap(gilstate, ...) functions. * _PyThreadState_GET() macro now calls _PyRuntimeState_GetThreadState() using &_PyRuntime. * Add 'ceval' parameter to COMPUTE_EVAL_BREAKER(), SIGNAL_PENDING_SIGNALS(), _PyEval_SignalAsyncExc(), _PyEval_SignalReceived() and _PyEval_FiniThreads() macros and functions. * Add 'tstate' parameter to call_function(), do_call_core() and do_raise(). * Add 'runtime' parameter to _Py_CURRENTLY_FINALIZING(), _Py_FinishPendingCalls() and _PyThreadState_DeleteExcept() macros and functions. * Declare 'runtime', 'tstate', 'ceval' and 'eval_breaker' variables as constant.
* bpo-36851: Clean the frame stack if the execution ends with a return and the ↵Pablo Galindo2019-05-091-7/+9
| | | | stack is not empty (GH-13191)
* bpo-36817: Add f-string debugging using '='. (GH-13123)Eric V. Smith2019-05-081-4/+6
| | | If a "=" is specified a the end of an f-string expression, the f-string will evaluate to the text of the expression, followed by '=', followed by the repr of the value of the expression.
* bpo-36475: Make PyThread_exit_thread with _Py_NO_RETURN (GH-13068)Victor Stinner2019-05-041-1/+0
|
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-18/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* Revert "bpo-36356: Destroy the GIL at exit (GH-12453)" (GH613006)Victor Stinner2019-04-291-11/+5
| | | This reverts commit b36e5d627d4232a01850707eb78a5067f3fd77f4.
* bpo-36356: Destroy the GIL at exit (GH-12453)Victor Stinner2019-04-291-5/+11
| | | | | | * Add _PyEval_FiniThreads2(). _PyEval_FiniThreads() now only clears the pending lock, whereas _PyEval_FiniThreads2() destroys the GIL. * pymain_free() now calls _PyEval_FiniThreads2(). * Py_FinalizeEx() now calls _PyEval_FiniThreads().
* bpo-36475: Finalize PyEval_AcquireLock() and PyEval_AcquireThread() properly ↵Joannah Nanjekye2019-04-291-12/+16
| | | | | | | | (GH-12667) PyEval_AcquireLock() and PyEval_AcquireThread() now terminate the current thread if called while the interpreter is finalizing, making them consistent with PyEval_RestoreThread(), Py_END_ALLOW_THREADS, and PyGILState_Ensure().
* Fix typo in 'tandem' word (GH-12998) (GH-12998)Andrey2019-04-281-1/+1
|
* bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)Victor Stinner2019-04-171-0/+4
| | | | | | | | | | | | | | | | | | | | Change PyAPI_FUNC(type), PyAPI_DATA(type) and PyMODINIT_FUNC macros of pyport.h when Py_BUILD_CORE_MODULE is defined. The Py_BUILD_CORE_MODULE define must be now be used to build a C extension as a dynamic library accessing Python internals: export the PyInit_xxx() function in DLL exports on Windows. Changes: * Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE now imply Py_BUILD_CORE directy in pyport.h. * ceval.c compilation now fails with an error if Py_BUILD_CORE is not defined, just to ensure that Python is build with the correct defines. * setup.py now compiles _pickle.c with Py_BUILD_CORE_MODULE define. * setup.py compiles _json.c with Py_BUILD_CORE_MODULE define, rather than Py_BUILD_CORE_BUILTIN define * PCbuild/pythoncore.vcxproj: Add Py_BUILD_CORE_BUILTIN define.
* bpo-33608: Revert "Factor out a private, per-interpreter ↵Eric Snow2019-04-121-78/+64
| | | | | _Py_AddPendingCall()." (gh-12806) This reverts commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (gh-12360).
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-04-121-64/+78
| | | | | (gh-12360) This is effectively an un-revert of #11617 and #12024 (reverted in #12159). Portions of those were merged in other PRs (with lower risk) and this represents the remainder. Note that I found 3 different bugs in the original PRs and have fixed them here.
* bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504)Stefan Krah2019-03-251-3/+3
|
* bpo-36333, bpo-36356: Fix _PyEval_FiniThreads() (GH-12432)Victor Stinner2019-03-191-2/+11
| | | _PyEval_FiniThreads() now free the pending lock.
* bpo-33608: Deal with pending calls relative to runtime shutdown. (gh-12246)Eric Snow2019-03-151-21/+61
|
* bpo-33608: Fix PyEval_InitThreads() warning (GH-12346)Victor Stinner2019-03-151-1/+1
| | | | | | | | The function has no return value. Fix the following warning on Windows: python\ceval.c(180): warning C4098: 'PyEval_InitThreads': 'void' function returning a value
* bpo-33608: Make sure locks in the runtime are properly re-created. (gh-12245)Eric Snow2019-03-081-39/+10
|
* bpo-33608: Minor cleanup related to pending calls. (gh-12247)Eric Snow2019-03-081-32/+48
|
* Simplify DISPATCH by hoisting eval_breaker ahead of time. (gh-12243)Eric Snow2019-03-081-2/+3
|
* Revert: bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-03-041-118/+82
| | | | | | | | | | | | | | | | | | | _Py_AddPendingCall(). (GH-11617) (GH-12159) * Revert "bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (#12003)" This reverts commit bcfa450f210074e16feb761ae5b3e966a2532fcf. * Revert "bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)" This reverts commit bda918bf65a88560ec453aaba0758a9c0d49b449. * Revert "bpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)" This reverts commit b05b711a2cef6c6c381e01069dedac372e0b9fb2. * Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)" This reverts commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465.
* bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. ↵Eric Snow2019-03-011-2/+3
| | | | | (gh-12062) This includes fixes to various _Py_atomic_* macros.