summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36346: Prepare for removing the legacy Unicode C API (AC only). (GH-21223)Serhiy Storchaka2020-06-301-0/+5
|
* bpo-41123: Remove PyUnicode_AsUnicodeCopy (GH-21209)Inada Naoki2020-06-301-8/+0
|
* bpo-23427: Add sys.orig_argv attribute (GH-20729)Victor Stinner2020-06-291-6/+8
| | | | | | | Add sys.orig_argv attribute: the list of the original command line arguments passed to the Python executable. Rename also PyConfig._orig_argv to PyConfig.orig_argv and document it.
* bpo-41123: Remove PyLong_FromUnicode() (GH-21204)Inada Naoki2020-06-291-2/+0
|
* bpo-41123: Remove PyUnicode_GetMax() (GH-21192)Inada Naoki2020-06-291-3/+0
|
* bpo-41123: Remove Py_UNICODE_str* functions (GH-21164)Inada Naoki2020-06-271-37/+0
| | | They are undocumented and deprecated since Python 3.3.
* bpo-41103: Remove old buffer protocol support (#21117)Inada Naoki2020-06-251-47/+0
| | | They are deprecated since Python 3.0.
* bpo-40521: Optimize PyBytes_FromStringAndSize(str, 0) (GH-21142)Victor Stinner2020-06-252-2/+3
| | | | | | | | | | | | | | | | Always create the empty bytes string singleton. Optimize PyBytes_FromStringAndSize(str, 0): it no longer has to check if the empty string singleton was created or not, it is always available. Add functions: * _PyBytes_Init() * bytes_get_empty(), bytes_new_empty() * bytes_create_empty_string_singleton() * unicode_create_empty_string_singleton() _Py_unicode_state: rename empty structure member to empty_string.
* bpo-40521: Always create the empty tuple singleton (GH-21116)Victor Stinner2020-06-241-0/+1
| | | | | | | | | | | Py_InitializeFromConfig() now always creates the empty tuple singleton as soon as possible. Optimize PyTuple_New(0): it no longer has to check if the empty tuple was created or not, it is always creatd. * Add tuple_create_empty_tuple_singleton() function. * Add tuple_get_empty() function. * Remove state parameter of tuple_alloc().
* bpo-40521: Make Unicode latin1 singletons per interpreter (GH-21101)Victor Stinner2020-06-241-0/+3
| | | | | | | | | Each interpreter now has its own Unicode latin1 singletons. Remove "ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS" and "ifdef LATIN1_SINGLETONS": always enable latin1 singletons. Optimize unicode_result_ready(): only attempt to get a latin1 singleton for PyUnicode_1BYTE_KIND.
* bpo-40521: Make empty Unicode string per interpreter (GH-21096)Victor Stinner2020-06-232-1/+3
| | | Each interpreter now has its own empty Unicode string singleton.
* bpo-40521: Make MemoryError free list per interpreter (GH-21086)Victor Stinner2020-06-232-2/+10
| | | | | | | Each interpreter now has its own MemoryError free list: it is not longer shared by all interpreters. Add _Py_exc_state structure and PyInterpreterState.exc_state member. Move also errnomap into _Py_exc_state.
* bpo-40521: Empty frozenset is no longer a singleton (GH-21085)Raymond Hettinger2020-06-232-3/+0
| | | | | | | | | * Revert "bpo-40521: Make the empty frozenset per interpreter (GH-21068)" This reverts commit 261cfedf7657a515e04428bba58eba2a9bb88208. * bpo-40521: Empty frozensets are no longer singletons * Complete the removal of the frozenset singleton
* bpo-40521: Make bytes singletons per interpreter (GH-21074)Victor Stinner2020-06-232-1/+7
| | | | | | Each interpreter now has its own empty bytes string and single byte character singletons. Replace STRINGLIB_EMPTY macro with STRINGLIB_GET_EMPTY() macro.
* bpo-40521: Make the empty frozenset per interpreter (GH-21068)Victor Stinner2020-06-232-1/+3
| | | Each interpreter now has its own empty frozenset singleton.
* bpo-40521: Make dict free lists per-interpreter (GH-20645)Victor Stinner2020-06-233-15/+26
| | | | | | | | | | | Each interpreter now has its own dict free list: * Move dict free lists into PyInterpreterState. * Move PyDict_MAXFREELIST define to pycore_interp.h * Add _Py_dict_state structure. * Add tstate parameter to _PyDict_ClearFreeList() and _PyDict_Fini(). * In debug mode, ensure that the dict free lists are not used after _PyDict_Fini() is called. * Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".
* bpo-41078: Add pycore_list.h internal header file (GH-21057)Victor Stinner2020-06-222-1/+20
| | | | | * Move _PyList_ITEMS() to pycore_list.h. * The C extension "_heapq" is now built with Py_BUILD_CORE_MODULE macro defined to access the internal C API.
* bpo-41078: Rename pycore_tupleobject.h to pycore_tuple.h (GH-21056)Victor Stinner2020-06-221-3/+4
|
* bpo-40939: Rename PyPegen* functions to PyParser* (GH-21016)Lysandros Nikolaou2020-06-213-62/+19
| | | | | | Rename PyPegen* functions to PyParser*, so that we can remove the old set of PyParser* functions that were using the old parser.
* bpo-40939: Remove the old parser (Part 2) (GH-21005)Lysandros Nikolaou2020-06-207-366/+0
| | | Remove some remaining files and Makefile targets for the old parser
* bpo-36346: Make unicodeobject.h C89 compatible (GH-20934)Inada Naoki2020-06-171-1/+2
|
* bpo-35059: Enhance _PyObject_GC_TRACK() macros (GH-20931)Victor Stinner2020-06-171-14/+34
| | | | | * Rename _PyObject_GC_TRACK_impl() to _PyObject_GC_TRACK() * Rename _PyObject_GC_UNTRACK_impl() to _PyObject_GC_UNTRACK() * Omit filename and lineno parameters if NDEBUG is defined.
* bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)Inada Naoki2020-06-171-23/+23
| | | | Co-authored-by: Kyle Stanley <aeros167@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40989: Make _PyTraceMalloc_NewReference() internal (GH-20915)Victor Stinner2020-06-162-4/+6
| | | | Make the _PyTraceMalloc_NewReference() function fully internal: remove it from the public C API and don't export it anymore.
* bpo-19569: Add a macro to suppress deprecation warnings (GH-9004)Zackery Spytz2020-06-161-0/+20
| | | Co-authored-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
* bpo-40989: PyObject_INIT() becomes an alias to PyObject_Init() (GH-20901)Victor Stinner2020-06-154-59/+42
| | | | | | | | | | | | | | The PyObject_INIT() and PyObject_INIT_VAR() macros become aliases to, respectively, PyObject_Init() and PyObject_InitVar() functions. Rename _PyObject_INIT() and _PyObject_INIT_VAR() static inline functions to, respectively, _PyObject_Init() and _PyObject_InitVar(), and move them to pycore_object.h. Remove their return value: their return type becomes void. The _datetime module is now built with the Py_BUILD_CORE_MODULE macro defined. Remove an outdated comment on _Py_tracemalloc_config.
* bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)Victor Stinner2020-06-151-15/+2
| | | | | | | | | | On Windows, #include "pyerrors.h" no longer defines "snprintf" and "vsnprintf" macros. PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable behavior. Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf() calls with PyOS_vsnprintf().
* bpo-29782: Consolidate _Py_Bit_Length() (GH-20739)Niklas Fiekas2020-06-152-12/+43
| | | | | | | | | | In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better location. GH-20518 added a more appropriate header file for bit utilities. It also shows how to properly use intrinsics. This allows reconsidering bpo-29782. * Move the function to the new header. * Changed return type to match __builtin_clzl() and reviewed usage. * Use intrinsics where available. * Pick a fallback implementation suitable for inlining.
* bpo-40939: Remove the old parser (GH-20768)Pablo Galindo2020-06-111-4/+0
| | | This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
* bpo-39465: Use _PyInterpreterState_GET() (GH-20788)Victor Stinner2020-06-101-7/+7
| | | | | | | | | | | | Replace _PyThreadState_GET() with _PyInterpreterState_GET() in: * get_small_int() * gcmodule.c: add also get_gc_state() function * _PyTrash_deposit_object() * _PyTrash_destroy_chain() * warnings_get_state() * Py_GetRecursionLimit() Cleanup listnode.c: add 'parser' variable.
* bpo-40943: Replace PY_FORMAT_SIZE_T with "z" (GH-20781)Victor Stinner2020-06-101-1/+3
| | | | | | | The PEP 353, written in 2005, introduced PY_FORMAT_SIZE_T. Python no longer supports macOS 10.4 and Visual Studio 2010, but requires more recent macOS and Visual Studio versions. In 2020 with Python 3.10, it is now safe to use directly "%zu" to format size_t and "%zi" to format Py_ssize_t.
* bpo-40910: Export Py_GetArgcArgv() function (GH-20721)Victor Stinner2020-06-082-1/+17
| | | | | | | | | | | | Export explicitly the Py_GetArgcArgv() function to the C API and document the function. Previously, it was exported implicitly which no longer works since Python is built with -fvisibility=hidden. * Add PyConfig._orig_argv member. * Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice. * PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now _PyConfig_Write() responsibility. * _PyConfig_Write() result type becomes PyStatus instead of void. * Write an unit test on Py_GetArgcArgv().
* bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var ↵Sandro Mani2020-06-081-0/+1
| | | | (GH-20605)
* bpo-29882: Add _Py_popcount32() function (GH-20518)Victor Stinner2020-06-081-1/+50
| | | | | | * Rename pycore_byteswap.h to pycore_bitutils.h. * Move popcount_digit() to pycore_bitutils.h as _Py_popcount32(). * _Py_popcount32() uses GCC and clang builtin function if available. * Add unit tests to _Py_popcount32().
* bpo-40724: Support setting buffer slots from type specs (GH-20648)scoder2020-06-061-0/+5
| | | This is not part of the limited API but makes the buffer slots available for type specs.
* bpo-40521: Make context free list per-interpreter (GH-20644)Victor Stinner2020-06-053-2/+9
| | | | | | | | | Each interpreter now has its own context free list: * Move context free list into PyInterpreterState. * Add _Py_context_state structure. * Add tstate parameter to _PyContext_ClearFreeList() and _PyContext_Fini(). * Pass tstate to clear_freelists().
* bpo-40521: Make async gen free lists per-interpreter (GH-20643)Victor Stinner2020-06-053-2/+20
| | | | | | | | | Each interpreter now has its own asynchronous generator free lists: * Move async gen free lists into PyInterpreterState. * Move _PyAsyncGen_MAXFREELIST define to pycore_interp.h * Add _Py_async_gen_state structure. * Add tstate parameter to _PyAsyncGen_ClearFreeLists and _PyAsyncGen_Fini().
* bpo-40521: Make list free list per-interpreter (GH-20642)Victor Stinner2020-06-053-2/+13
| | | | | | | | | | | | Each interpreter now has its own list free list: * Move list numfree and free_list into PyInterpreterState. * Add _Py_list_state structure. * Add tstate parameter to _PyList_ClearFreeList() and _PyList_Fini(). * Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS". * _PyGC_Fini() clears gcstate->garbage list which can be stored in the list free list. Call _PyGC_Fini() before _PyList_Fini() to prevent leaking this list.
* bpo-40521: Make frame free list per-interpreter (GH-20638)Victor Stinner2020-06-043-2/+9
| | | | | | | | | | Each interpreter now has its own frame free list: * Move frame free list into PyInterpreterState. * Add _Py_frame_state structure. * Add tstate parameter to _PyFrame_ClearFreeList() and _PyFrame_Fini(). * Remove "#if PyFrame_MAXFREELIST > 0". * Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".
* bpo-40521: Make slice cache per-interpreter (GH-20637)Victor Stinner2020-06-042-1/+5
| | | | | | Each interpreter now has its own slice cache: * Move slice cache into PyInterpreterState. * Add tstate parameter to _PySlice_Fini().
* bpo-40521: Make float free list per-interpreter (GH-20636)Victor Stinner2020-06-043-2/+11
| | | | | | | | Each interpreter now has its own float free list: * Move tuple numfree and free_list into PyInterpreterState. * Add _Py_float_state structure. * Add tstate parameter to _PyFloat_ClearFreeList() and _PyFloat_Fini().
* bpo-40521: Make tuple free list per-interpreter (GH-20247)Victor Stinner2020-06-043-2/+23
| | | | | | | | | | Each interpreter now has its own tuple free lists: * Move tuple numfree and free_list arrays into PyInterpreterState. * Define PyTuple_MAXSAVESIZE and PyTuple_MAXFREELIST macros in pycore_interp.h. * Add _Py_tuple_state structure. Pass it explicitly to tuple_alloc(). * Add tstate parameter to _PyTuple_ClearFreeList() * Each interpreter now has its own empty tuple singleton.
* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)Victor Stinner2020-06-031-0/+3
| | | | | | | | | | | | my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for pending signals, rather calling PyOS_InterruptOccurred(). my_fgets() is called with the GIL released, whereas PyOS_InterruptOccurred() must be called with the GIL held. test_repl: use text=True and avoid SuppressCrashReport in test_multiline_string_parsing(). Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.
* PyOS_AfterFork_Child() pass tstate to _PyEval_ReInitThreads() (GH-20598)Victor Stinner2020-06-021-1/+1
|
* PyOS_AfterFork_Child() uses PyStatus (GH-20596)Victor Stinner2020-06-025-7/+8
| | | | | | | | PyOS_AfterFork_Child() helper functions now return a PyStatus: PyOS_AfterFork_Child() is now responsible to handle errors. * Move _PySignal_AfterFork() to the internal C API * Add #ifdef HAVE_FORK on _PyGILState_Reinit(), _PySignal_AfterFork() and _PyInterpreterState_DeleteExceptMain().
* bpo-40244: Remove XLC's support from the noreturn flag (GH-20588)Batuhan Taskaya2020-06-021-2/+2
| | | Automerge-Triggered-By: @pablogsal
* bpo-39583: Remove superfluous "extern C" bits from Include/cpython/*.h ↵Skip Montanaro2020-06-0119-151/+1
| | | | (GH-18413)
* bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)Victor Stinner2020-06-011-1/+18
| | | | Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if tstate is NULL, the error message contains the current function name.
* bpo-40792: Make the result of PyNumber_Index() always having exact type int. ↵Serhiy Storchaka2020-05-281-0/+3
| | | | | | | | | | | | (GH-20443) Previously, the result could have been an instance of a subclass of int. Also revert bpo-26202 and make attributes start, stop and step of the range object having exact type int. Add private function _PyNumber_Index() which preserves the old behavior of PyNumber_Index() for performance to use it in the conversion functions like PyLong_AsLong().
* bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)Victor Stinner2020-05-271-2/+17
| | | | | | | | | | | Convert Py_REFCNT() and Py_SIZE() macros to static inline functions. They cannot be used as l-value anymore: use Py_SET_REFCNT() and Py_SET_SIZE() to set an object reference count and size. Replace &Py_SIZE(self) with &((PyVarObject*)self)->ob_size in arraymodule.c. This change is backward incompatible on purpose, to prepare the C API for an opaque PyObject structure.