summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37207: Add _PyArg_NoKwnames() helper function (GH-18980)Dong-hee Na2020-03-161-0/+3
|
* bpo-39969: Remove ast.Param node class as is no longer used (GH-19020)Batuhan Taşkaya2020-03-151-2/+2
|
* Make cpython/abstract.h compatible with C90 (#18481)Peter Eisentraut2020-03-141-11/+24
| | | | | | Some inline functions use mixed declarations and code. These end up visible in third-party code that includes Python.h, which might not be using a C99 compiler. Fix by moving the declarations first, like in the old days.
* Revert "bpo-39087: Add _PyUnicode_GetUTF8Buffer()" (GH-18985)Inada Naoki2020-03-141-13/+0
| | | | | | | * Revert "bpo-39087: Add _PyUnicode_GetUTF8Buffer() (GH-17659)" This reverts commit c7ad974d341d3edb6b9d2a2dcae4d3d4794ada6b. * Update unicodeobject.h
* bpo-39087: Add _PyUnicode_GetUTF8Buffer() (GH-17659)Inada Naoki2020-03-141-6/+13
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39947: Add PyThreadState_GetInterpreter() (GH-18981)Victor Stinner2020-03-131-0/+5
| | | | Add PyThreadState_GetInterpreter(tstate): get the interpreter of a Python thread state.
* bpo-39947: Add PyInterpreterState_Get() function (GH-18979)Victor Stinner2020-03-132-7/+13
| | | | | | * Rename _PyInterpreterState_Get() to PyInterpreterState_Get() and move it the limited C API. * Add _PyInterpreterState_Get() alias to PyInterpreterState_Get() for backward compatibility with Python 3.8.
* bpo-39947: Hide implementation detail of trashcan macros (GH-18971)Victor Stinner2020-03-131-15/+18
| | | | | | Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer access PyThreadState attributes, but call new private _PyTrash_begin() and _PyTrash_end() functions which hide implementation details.
* bpo-35370: Add _PyEval_SetTrace() function (GH-18975)Victor Stinner2020-03-132-1/+9
| | | | | | | | | * sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable() now properly report PySys_Audit() error if "sys.setprofile" or "sys.settrace" audit event is denied. * Add _PyEval_SetProfile() and _PyEval_SetTrace() function: similar to PyEval_SetProfile() and PyEval_SetTrace() but take a tstate parameter and return -1 on error. * Add _PyObject_FastCallTstate() function.
* bpo-39947: Move Py_EnterRecursiveCall() to internal C API (GH-18972)Victor Stinner2020-03-132-56/+60
| | | | | | Move the static inline function flavor of Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() to the internal C API: they access PyThreadState attributes. The limited C API provides regular functions which hide implementation details.
* bpo-38500: Add _PyInterpreterState_SetEvalFrameFunc() (GH-17340)Victor Stinner2020-03-124-4/+12
| | | | | | | | | | | | PyInterpreterState.eval_frame function now requires a tstate (Python thread state) parameter. Add private functions to the C API to get and set the frame evaluation function: * Add tstate parameter to _PyFrameEvalFunction function type. * Add _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions. * Add tstate parameter to _PyEval_EvalFrameDefault().
* bpo-38631: _PyGILState_Init() returns PyStatus (GH-18908)Victor Stinner2020-03-101-1/+1
| | | | _PyGILState_Init() now returns PyStatus rather than calling Py_FatalError() on failure.
* bpo-34822: Simplify AST for subscription. (GH-9605)Serhiy Storchaka2020-03-101-30/+11
| | | | | | | | | * Remove the slice type. * Make Slice a kind of the expr type instead of the slice type. * Replace ExtSlice(slices) with Tuple(slices, Load()). * Replace Index(value) with a value itself. All non-terminal nodes in AST for expressions are now of the expr type.
* bpo-39877: Deprecate PyEval_InitThreads() (GH-18892)Victor Stinner2020-03-101-2/+2
| | | | Deprecated PyEval_InitThreads() and PyEval_ThreadsInitialized(). Calling PyEval_InitThreads() now does nothing.
* bpo-39877: PyGILState_Ensure() don't call PyEval_InitThreads() (GH-18891)Victor Stinner2020-03-091-0/+1
| | | | | | | | PyGILState_Ensure() doesn't call PyEval_InitThreads() anymore when a new Python thread state is created. The GIL is created by Py_Initialize() since Python 3.7, it's not needed to call PyEval_InitThreads() explicitly. Add an assertion to ensure that the GIL is already created.
* bpo-39877: Py_Initialize() pass tstate to PyEval_InitThreads() (GH-18884)Victor Stinner2020-03-091-0/+2
|
* bpo-39877: Remove useless PyEval_InitThreads() calls (GH-18883)Victor Stinner2020-03-091-3/+0
| | | | Py_Initialize() calls PyEval_InitThreads() since Python 3.7. It's no longer needed to call it explicitly.
* bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release ↵Serhiy Storchaka2020-03-091-3/+7
| | | | | mode. (GH-16329) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39882: Py_FatalError() logs the function name (GH-18819)Victor Stinner2020-03-062-1/+11
| | | | | | | | | | | | The Py_FatalError() function is replaced with a macro which logs automatically the name of the current function, unless the Py_LIMITED_API macro is defined. Changes: * Add _Py_FatalErrorFunc() function. * Remove the function name from the message of Py_FatalError() calls which included the function name. * Update tests.
* bpo-39877: _PyRuntimeState.finalizing becomes atomic (GH-18816)Victor Stinner2020-03-061-6/+17
| | | | | | | | | | | | Convert _PyRuntimeState.finalizing field to an atomic variable: * Rename it to _finalizing * Change its type to _Py_atomic_address * Add _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing() functions * Remove _Py_CURRENTLY_FINALIZING() function: replace it with testing directly _PyRuntimeState_GetFinalizing() value Convert _PyRuntimeState_GetThreadState() to static inline function.
* bpo-39573: Make Py_IS_TYPE() take constant parameters (GH-18799)Andy Lester2020-03-061-2/+3
| | | Add _PyObject_CAST_CONST() macro: cast a pointer to (const PyObject *).
* bpo-39639: Remove the AST "Suite" node and associated code (GH-18513)Batuhan Taşkaya2020-03-041-7/+1
| | | | | | | | The AST "Suite" node is no longer used and it can be removed from the ASDL definition and related structures (compiler, visitors, ...). Co-Authored-By: Victor Stinner <vstinner@python.org> Co-authored-by: Brett Cannon <54418+brettcannon@users.noreply.github.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39573: Finish converting to new Py_IS_TYPE() macro (GH-18601)Andy Lester2020-03-041-2/+1
|
* bpo-39702: Relax grammar restrictions on decorators (PEP 614) (GH-18570)Brandt Bucher2020-03-031-1/+0
|
* bpo-39796: Fix _warnings module initialization (GH-18739)Victor Stinner2020-03-021-0/+2
| | | | | | | | | * Add _PyWarnings_InitState() which only initializes the _warnings module state (tstate->interp->warnings) without creating a module object * Py_InitializeFromConfig() now calls _PyWarnings_InitState() instead of _PyWarnings_Init() * Rename also private functions of _warnings.c to avoid confusion between the public C API and the private C API.
* Post 3.9.0a4Łukasz Langa2020-02-261-1/+1
|
* Python 3.9.0a4v3.9.0a4Łukasz Langa2020-02-251-2/+2
|
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-172-2/+2
|
* bpo-39573: PyXXX_Check() macros use Py_IS_TYPE() (GH-18508)Dong-hee Na2020-02-142-3/+3
| | | | Update PyXXX_Check() macros in Include/ to use the new Py_IS_TYPE function.
* bpo-39573: Add Py_IS_TYPE() function (GH-18488)Dong-hee Na2020-02-1329-45/+50
| | | Co-Author: Neil Schemenauer <nas-github@arctrix.com>
* bpo-39573: Fix bad copy-paste in Py_SET_SIZE (GH-18496)Brandt Bucher2020-02-131-3/+3
|
* bpo-35134: Add Include/cpython/fileutils.h header file (GH-18493)Victor Stinner2020-02-122-164/+168
| | | | | | | | | | | | Move CPython C API from Include/fileutils.h into a new Include/cpython/fileutils.h header file which is included by Include/fileutils.h. Exclude the following private symbols from the limited C API: * _Py_error_handler * _Py_GetErrorHandler() * _Py_DecodeLocaleEx() * _Py_EncodeLocaleEx()
* bpo-35134: Add Include/cpython/bytesobject.h file (GH-18494)Victor Stinner2020-02-124-140/+145
| | | | | | | | | Add Include/cpython/bytearrayobject.h and Include/cpython/bytesobject.h header files. Move CPython C API from Include/bytesobject.h into a new Include/cpython/bytesobject.h header file which is included by Include/bytesobject.h. Do a similar change for Include/bytearrayobject.h.
* bpo-35081: Move dtoa.h header to the internal C API (GH-18489)Victor Stinner2020-02-122-5/+8
| | | | | | | Move the dtoa.h header file to the internal C API as pycore_dtoa.h: it only contains private functions (prefixed by "_Py"). The math and cmath modules must now be compiled with the Py_BUILD_CORE macro defined.
* bpo-35081: Move bytes_methods.h to the internal C API (GH-18492)Victor Stinner2020-02-121-0/+4
| | | | | Move the bytes_methods.h header file to the internal C API as pycore_bytes_methods.h: it only contains private symbols (prefixed by "_Py"), except of the PyDoc_STRVAR_shared() macro.
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-39573: Add Py_SET_SIZE() function (GH-18400)Victor Stinner2020-02-072-1/+6
| | | Add Py_SET_SIZE() function to set the size of an object.
* bpo-35134: Create Include/cpython/listobject.h (GH-18395)Victor Stinner2020-02-072-43/+59
| | | | | | | | | Move listobject.h code surrounded by "#ifndef Py_LIMITED_API" to a new Include/cpython/listobject.h header file. Add cpython/ header files to Makefile.pre.in and pythoncore project of PCbuild. Add _PyList_CAST() macro.
* bpo-39573: Add Py_SET_TYPE() function (GH-18394)Victor Stinner2020-02-072-1/+7
| | | Add Py_SET_TYPE() function to set the type of an object.
* bpo-39573: Use Py_TYPE() macro in Python and Include directories (GH-18391)Victor Stinner2020-02-073-10/+10
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-39571: Fix clang warning on PyTypeObject typedef (GH-18385)Victor Stinner2020-02-071-2/+2
| | | Only define PyTypeObject type once.
* bpo-39573: Add Py_SET_REFCNT() function (GH-18389)Victor Stinner2020-02-071-0/+5
| | | | Add a Py_SET_REFCNT() function to set the reference counter of an object.
* bpo-39245: Make Vectorcall C API public (GH-17893)Petr Viktorin2020-02-062-15/+26
| | | | | | | | | | | | | | | | | * Add backcompat defines and move non-limited API declaration to cpython/ This partially reverts commit 2ff58a24e8a1c7e290d025d69ebaea0bbead3b8c which added PyObject_CallNoArgs to the 3.9+ stable ABI. This should not be done; there are enough other call APIs in the stable ABI to choose from. * Adjust documentation Mark all newly public functions as added in 3.9. Add a note about the 3.8 provisional names. Add notes on public API. * Put PyObject_CallNoArgs back in the limited API * Rename PyObject_FastCallDict to PyObject_VectorcallDict
* bpo-39127: Make _Py_HashPointer's argument be const (GH-17690)Andy Lester2020-02-051-1/+1
|
* bpo-39542: Declare _Py_AddToAllObjects() in pycore_object.h (GH-18368)Victor Stinner2020-02-051-0/+1
| | | | | | _Py_AddToAllObjects() is used in bltinmodule.c and typeobject.c when Py_TRACE_REFS is defined. Fix Py_TRACE_REFS build.
* Add PyInterpreterState.fs_codec.utf8 (GH-18367)Victor Stinner2020-02-051-0/+1
| | | | | | Add a fast-path for UTF-8 encoding in PyUnicode_EncodeFSDefault() and PyUnicode_DecodeFSDefaultAndSize(). Add _PyUnicode_FiniEncodings() helper function for _PyUnicode_Fini().
* bpo-39542: Define PyTypeObject earlier in object.h (GH-18366)Victor Stinner2020-02-051-20/+16
| | | Replace "struct _typeobject" with PyTypeObject in object.h.
* bpo-39542: Convert PyType_Check() to static inline function (GH-18364)Victor Stinner2020-02-052-11/+22
| | | | Convert PyType_HasFeature(), PyType_Check() and PyType_CheckExact() macros to static inline functions.
* bpo-39542: Make PyObject_INIT() opaque in limited C API (GH-18363)Victor Stinner2020-02-054-45/+62
| | | | | | | | | | | | | | In the limited C API, PyObject_INIT() and PyObject_INIT_VAR() are now defined as aliases to PyObject_Init() and PyObject_InitVar() to make their implementation opaque. It avoids to leak implementation details in the limited C API. Exclude the following functions from the limited C API, move them from object.h to cpython/object.h: * _Py_NewReference() * _Py_ForgetReference() * _PyTraceMalloc_NewReference() * _Py_GetRefTotal()
* bpo-39542: Exclude trashcan from the limited C API (GH-18362)Victor Stinner2020-02-052-87/+86
| | | | | | | | Exclude trashcan mechanism from the limited C API: it requires access to PyTypeObject and PyThreadState structure fields, whereas these structures are opaque in the limited C API. The trashcan mechanism never worked with the limited C API. Move it from object.h to cpython/object.h.