summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/C API
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.11.0rc1v3.11.0rc1Pablo Galindo2022-08-052-5/+0
|
* gh-94936: C getters: co_varnames, co_cellvars, co_freevars (GH-95008)Miss Islington (bot)2022-08-041-0/+3
| | | | | (cherry picked from commit 42b102bbf9a9ae6fae8f6710202fb7afeeac277c) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* GH-92678: Fix tp_dictoffset inheritance. (GH-95596) (GH-95604)Mark Shannon2022-08-041-0/+2
| | | | | * Add test for inheriting explicit __dict__ and weakref. * Restore 3.10 behavior for multiple inheritance of C extension classes that store their dictionary at the end of the struct.
* Python 3.11.0b5v3.11.0b5Pablo Galindo2022-07-254-10/+0
|
* [3.11] GH-92678: Expose managed dict clear and visit functions (GH-95246). ↵Pablo Galindo Salgado2022-07-251-0/+3
| | | | | (#95256) Co-authored-by: Mark Shannon <mark@hotpy.org>
* gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931)Miss Islington (bot)2022-07-181-0/+2
| | | | | (cherry picked from commit 067f0da33506f70c36a67d5f3d8d011c8dae10c9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-94864: Fix PyArg_Parse* with deprecated format units "u" and "Z" (GH-94902)Serhiy Storchaka2022-07-171-0/+2
| | | It returned 1 (success) when warnings are turned into exceptions.
* gh-94731: Revert to C-style casts for _Py_CAST (GH-94782) (#94849)Miss Islington (bot)2022-07-151-0/+3
| | | | | Co-authored-by: da-woods <dw-git@d-woods.co.uk> (cherry picked from commit 6cbb57f62d345d7a5d6aeb1b3b5d37a845344d5e)
* Python 3.11.0b4v3.11.0b4Pablo Galindo2022-07-114-22/+0
|
* gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938) (#94000)Victor Stinner2022-06-201-0/+14
| | | | | | | | | | | | | | | | | | Move the follow functions and type from frameobject.h to pyframe.h, so the standard <Python.h> provide frame getter functions: * PyFrame_Check() * PyFrame_GetBack() * PyFrame_GetBuiltins() * PyFrame_GetGenerator() * PyFrame_GetGlobals() * PyFrame_GetLasti() * PyFrame_GetLocals() * PyFrame_Type Remove #include "frameobject.h" from many C files. It's no longer needed. (cherry picked from commit 27b989403356ccdd47545a93aeab8434e9c69f21)
* gh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid ↵Miss Islington (bot)2022-06-161-0/+3
| | | | | | | UB (GH-93700) (cherry picked from commit 65ff27c7d30b84655bf8caf6e396c65485708148) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* gh-91321: Fix compatibility with C++ older than C++11 (#93784) (#93802)Victor Stinner2022-06-141-0/+2
| | | | | | | | | | | * Fix the compatibility of the Python C API with C++ older than C++11. * _Py_NULL is only defined as nullptr on C++11 and newer. (cherry picked from commit 4caf5c2753f1aa28d6f4bc1aa377975fd2a62331) * test_cppext now builds the C++ extension with setuptools. * Add @test.support.requires_venv_with_pip. (cherry picked from commit ca0cc9c433830e14714a5cc93fb4e7254da3dd76)
* gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (GH-93500) (gh-93507)Miss Islington (bot)2022-06-051-0/+3
| | | | | | | | | | | | | | | | | Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow C++ extensions that pass 0 or NULL to macros using _Py_CAST() to continue to compile. Without this, you get an error like: invalid ‘static_cast’ from type ‘int’ to type ‘_object*’ The modern way to use a NULL value in C++ is to use nullptr. However, we want to not break extensions that do things the old way. Co-authored-by: serge-sans-paille (cherry picked from commit 8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com> Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
* Python 3.11.0b2v3.11.0b2Pablo Galindo2022-05-303-7/+0
|
* gh-92898: Enhance _testcppext test on cast to PyObject* (GH-93111)Miss Islington (bot)2022-05-261-0/+2
| | | | | | | * Add StrongRef class. * Rename and reformat functions of the _Py_CAST() implementation. (cherry picked from commit 20d30ba2ccf9182e4f08db112f428c909148a40b) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields ↵Miss Islington (bot)2022-05-191-0/+2
| | | | | | | (GH-92980) (cherry picked from commit 403d16fa28764718dcd0536ccb3ab8d05768465d) Co-authored-by: Steve Dower <steve.dower@python.org>
* gh-92781: Avoid mixing declarations and code in C API (#92783) (#92813)Victor Stinner2022-05-161-0/+3
| | | | | | | Avoid mixing declarations and code in the C API to fix the compiler warning: "ISO C90 forbids mixed declarations and code" [-Werror=declaration-after-statement]. (cherry picked from commit 90e72300730189c4a48529baaad9b0005d40731c)
* Python 3.11.0b1Pablo Galindo2022-05-0612-28/+0
|
* gh-88279: Deprecate PySys_SetArgvEx() (#92363)Victor Stinner2022-05-061-0/+2
| | | | | | | Deprecate the following C functions: * PySys_SetArgv() * PySys_SetArgvEx() * PySys_SetPath()
* gh-92154: Expose PyCode_GetCode in the C API (GH-92168)Ken Jin2022-05-031-0/+2
|
* Fix the closure argument to PyEval_EvalCodeEx. (GH-92175)larryhastings2022-05-021-0/+1
|
* gh-91320: Add _Py_reinterpret_cast() macro (#91959)Victor Stinner2022-04-271-0/+3
| | | | | | | | | | | | | | Fix C++ compiler warnings about "old-style cast" (g++ -Wold-style-cast) in the Python C API. Use C++ reinterpret_cast<> and static_cast<> casts when the Python C API is used in C++. Example of fixed warning: Include/object.h:107:43: error: use of old-style cast to ‘PyObject*’ {aka ‘struct _object*’} [-Werror=old-style-cast] #define _PyObject_CAST(op) ((PyObject*)(op)) Add _Py_reinterpret_cast() and _Py_static_cast() macros.
* gh-80527: Deprecate PEP 623 Unicode functions (#91801)Victor Stinner2022-04-221-0/+3
| | | | | | | | | | | Deprecate functions: * PyUnicode_AS_DATA() * PyUnicode_AS_UNICODE() * PyUnicode_GET_DATA_SIZE() * PyUnicode_GET_SIZE() Previously, these functions were macros and so it wasn't possible to decorate them with Py_DEPRECATED().
* gh-91768: C API no longer use "const PyObject*" type (#91769)Victor Stinner2022-04-211-0/+3
| | | | | | | | | | | | | Py_REFCNT(), Py_TYPE(), Py_SIZE() and Py_IS_TYPE() functions argument type is now "PyObject*", rather than "const PyObject*". * Replace also "const PyObject*" with "PyObject*" in functions: * _Py_strhex_impl() * _Py_strhex_with_sep() * _Py_strhex_bytes_with_sep() * Remove _PyObject_CAST_CONST() and _PyVarObject_CAST_CONST() macros. * Py_IS_TYPE() can now use Py_TYPE() in its implementation.
* bpo-47169: Export PyOS_CheckStack on Windows (GH-32414)Petr Viktorin2022-04-211-0/+1
|
* gh-91020: Add `PyBytes_Type.tp_alloc` for subclass (GH-91686)Inada Naoki2022-04-201-0/+2
|
* bpo-40421: Cleanup PyFrame C API (GH-32417)Victor Stinner2022-04-191-1/+1
|
* gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)Irit Katriel2022-04-151-0/+5
|
* Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition ↵Petr Viktorin2022-04-081-0/+2
| | | | (GH-32365)
* Add new PyFrame_GetLasti C-API function (GH-32413)Mark Shannon2022-04-081-0/+2
|
* bpo-35134: Remove the Include/code.h header file (GH-32385)Victor Stinner2022-04-071-0/+2
| | | | | | Remove the Include/code.h header file. C extensions should only include the main <Python.h> header file. Python.h includes directly Include/cpython/code.h instead.
* Python 3.11.0a7v3.11.0a7Pablo Galindo2022-04-058-34/+0
|
* bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API ↵Victor Stinner2022-04-011-0/+6
| | | | | | | | | | | (GH-32054) Move the private _PyFrameEvalFunction type, and private _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions to the internal C API. The _PyFrameEvalFunction callback function type now uses the _PyInterpreterFrame type which is part of the internal C API. Update the _PyFrameEvalFunction documentation.
* bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)Victor Stinner2022-04-011-0/+3
| | | | | Move the private undocumented _PyEval_EvalFrameDefault() function to the internal C API. The function now uses the _PyInterpreterFrame type which is part of the internal C API.
* bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)Mark Shannon2022-03-311-0/+3
|
* bpo-46850: Remove _PyEval_CallTracing() function (GH-32019)Victor Stinner2022-03-211-0/+3
| | | | Remove the private undocumented function _PyEval_CallTracing() from the C API. Call the public sys.call_tracing() function instead.
* bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018)Victor Stinner2022-03-211-0/+4
| | | | | | | | | | | | | | | Remove the private undocumented function _PyEval_GetCoroutineOriginTrackingDepth() from the C API. Call the public sys.get_coroutine_origin_tracking_depth() function instead. Change the internal function _PyEval_SetCoroutineOriginTrackingDepth(): * Remove the 'tstate' parameter; * Add return value and raises an exception if depth is negative; * No longer export the function: call the public sys.set_coroutine_origin_tracking_depth() function instead. Uniformize also function declarations in pycore_ceval.h.
* bpo-46850: Remove _PyEval_SetAsyncGenFinalizer() (GH-32017)Victor Stinner2022-03-211-0/+9
| | | | | | | | | | | Remove the following private undocumented functions from the C API: * _PyEval_GetAsyncGenFirstiter() * _PyEval_GetAsyncGenFinalizer() * _PyEval_SetAsyncGenFirstiter() * _PyEval_SetAsyncGenFinalizer() Call the public sys.get_asyncgen_hooks() and sys.set_asyncgen_hooks() functions instead.
* bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835)Dong-hee Na2022-03-141-0/+2
|
* bpo-46906: Add PyFloat_Pack8() to the C API (GH-31657)Victor Stinner2022-03-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add new functions to pack and unpack C double (serialize and deserialize): * PyFloat_Pack2(), PyFloat_Pack4(), PyFloat_Pack8() * PyFloat_Unpack2(), PyFloat_Unpack4(), PyFloat_Unpack8() Document these functions and add unit tests. Rename private functions and move them from the internal C API to the public C API: * _PyFloat_Pack2() => PyFloat_Pack2() * _PyFloat_Pack4() => PyFloat_Pack4() * _PyFloat_Pack8() => PyFloat_Pack8() * _PyFloat_Unpack2() => PyFloat_Unpack2() * _PyFloat_Unpack4() => PyFloat_Unpack4() * _PyFloat_Unpack8() => PyFloat_Unpack8() Replace the "unsigned char*" type with "char*" which is more common and easy to use.
* Python 3.11.0a6v3.11.0a6Pablo Galindo2022-03-075-11/+0
|
* bpo-46836: Move PyFrameObject to pycore_frame.h (GH-31530)Victor Stinner2022-02-251-0/+2
| | | | Move the PyFrameObject type definition (struct _frame) to the internal C API pycore_frame.h header file.
* bpo-46748: Don't import <stdbool.h> in public headers (GH-31553)Petr Viktorin2022-02-251-0/+2
| | | | | | | <stdbool.h> is the standard/modern way to define embedd/extends Python free to define bool, true and false, but there are existing applications that use slightly different redefinitions, which fail if the header is included. It's OK to use stdbool outside the public headers, though. https://bugs.python.org/issue46748
* bpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171)Victor Stinner2022-02-231-0/+2
| | | | | | | | | | Remove the HAVE_PY_SET_53BIT_PRECISION macro (moved to the internal C API). * Move HAVE_PY_SET_53BIT_PRECISION macro to pycore_pymath.h. * Replace PY_NO_SHORT_FLOAT_REPR macro with _PY_SHORT_FLOAT_REPR macro which is always defined. gcc -Wundef emits a warning when using _PY_SHORT_FLOAT_REPR but the macro is not defined, if pycore_pymath.h include was forgotten.
* bpo-45459: Rename buffer.h to pybuffer.h (#31201)Victor Stinner2022-02-221-0/+3
| | | | | | | | | Rename Include/buffer.h header file to Include/pybuffer.h to avoid conflicts with projects having an existing "buffer.h" header file. * Incude pybuffer.h before object.h in Python.h. * Remove #include "buffer.h" from Include/cpython/object.h. * Add a forward declaration of the PyObject type in pybuffer.h to fix an inter-dependency issue.
* bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)Petr Viktorin2022-02-111-0/+2
| | | | | * Make PyType_GetModuleByDef public (remove underscore) Co-authored-by: Victor Stinner <vstinner@python.org>
* Python 3.11.0a5v3.11.0a5Pablo Galindo2022-02-035-11/+0
|
* bpo-46433: _PyType_GetModuleByDef: handle static types in MRO (GH-30696)Petr Viktorin2022-02-021-0/+2
| | | Automerge-Triggered-By: GH:encukou
* bpo-45459: Add Py_buffer to limited API (GH-29991)Christian Heimes2022-02-021-0/+2
| | | | | | | | | | | - [x] ``Py_buffer`` struct - [x] ``PyBuffer_*()`` API functions - [x] ``PyBUF_*`` constants - [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots - [x] ``PyMemoryView_FromBuffer()`` API - [x] tests for limited API - [x] ``make regen-limited-abi`` - [x] documentation update - [ ] export ``PyPickleBuffer*()`` API ???
* bpo-14916: use specified tokenizer fd for file input (GH-31006)Paul m. p. P2022-02-011-0/+1
| | | | | | | | | | @pablogsal, sorry i failed to rebase to main, so i recreated https://github.com/python/cpython/pull/22190#issuecomment-1024633392 > PyRun_InteractiveOne\*() functions allow to explicitily set fd instead of stdin. but stdin was hardcoded in readline call. > This patch does not fix target file for prompt unlike original bpo one : prompt fd is unrelated to tokenizer source which could be read only. It is more of a bugfix regarding the docs : actual documentation say "prompt the user" so one would expect prompt to go on stdout not a file for both PyRun_InteractiveOne\*() and PyRun_InteractiveLoop\*(). Automerge-Triggered-By: GH:pablogsal