Skip to content

Latest commit

 

History

History
2147 lines (1513 loc) · 45 KB

3.11.0b1.rst

File metadata and controls

2147 lines (1513 loc) · 45 KB

Add the :option:`-P` command line option and the :envvar:`PYTHONSAFEPATH` environment variable to not prepend a potentially unsafe path to :data:`sys.path`. Patch by Victor Stinner.

Chaining classmethod descriptors (introduced in bpo-19072) is deprecated. It can no longer be used to wrap other descriptors such as property(). The core design of this feature was flawed, and it caused a number of downstream problems.

pymain_run_python() now imports readline and rlcompleter before sys.path is extended to include the current working directory of an interactive interpreter. Non-interactive interpreters are not affected.

Improve the :exc:`AttributeError` message when deleting a missing attribute. Patch by Géry Ogam.

Make sure that PEP 523 is respected in all cases. In 3.11a7, specialization may have prevented Python-to-Python calls respecting PEP 523.

Add a closure keyword-only parameter to :func:`exec`. It can only be specified when exec-ing a code object that uses free variables. When specified, it must be a tuple, with exactly the number of cell variables referenced by the code object. closure has a default value of None, and it must be None if the code object doesn't refer to any free variables.

Disable frozen modules in debug builds. Patch by Kumar Aditya.

Improve error message when subscript a type with __class_getitem__ set to None.

Fix crash triggered by an evil custom mro() on a metaclass.

The PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS instruction now ensures methods are called only on objects of the correct type.

Deoptimize statically allocated code objects during Py_FINALIZE() so that future _PyCode_Quicken calls always start with unquickened code.

Fix a crash in subinterpreters related to the garbage collector. When a subinterpreter is deleted, untrack all objects tracked by its GC. To prevent a crash in deallocator functions expecting objects to be tracked by the GC, leak a strong reference to these objects on purpose, so they are never deleted and their deallocator functions are not called. Patch by Victor Stinner.

The interpreter can now autocomplete soft keywords, as of now match, case, and _ (wildcard pattern) from PEP 634.

The warning emitted by the Python parser for a numeric literal immediately followed by keyword has been changed from deprecation warning to syntax warning.

Fix an issue where specialized opcodes with extended arguments could produce incorrect tracing output or lead to assertion failures.

Speed up :class:`types.UnionType` instantiation. Based on patch provided by Yurii Karabas.

If Python is built in debug mode, Python now ensures that deallocator functions leave the current exception unchanged. Patch by Victor Stinner.

Fix a minor memory leak at exit: release the memory of the :class:`generic_alias_iterator` type. Patch by Donghee Na.

Octal escapes with value larger than 0o377 now produce a :exc:`DeprecationWarning`. In a future Python version they will be a :exc:`SyntaxWarning` and eventually a :exc:`SyntaxError`.

Use a single compact table for line starts, ends and column offsets. Reduces memory consumption for location info by half

Use Argument Clinic for :class:`EncodingMap`. Patch by Oleg Iarygin.

Fixed a crash in a garbage-collection edge-case, in which a PyFunction_Type.tp_clear function could leave a python function object in an inconsistent state.

Speed up :func:`isinstance` and :func:`issubclass` checks for :class:`types.UnionType`. Patch by Yurii Karabas.

Fixed a bug in which adaptive opcodes ignored any preceding EXTENDED_ARGs on specialization failure.

The LLTRACE special build now looks for the name __lltrace__ defined in module globals, rather than the name __ltrace__, which had been introduced as a typo.

Speed up iteration of ascii strings by 50%. Patch by Kumar Aditya.

Improve interpreter performance on Windows by inlining a few specific macros.

Add a new :c:func:`!_PyFrame_IsEntryFrame` API function, to check if a :c:type:`PyFrameObject` is an entry frame. Patch by Pablo Galindo.

Refactor the bytearray strip methods strip, lstrip and rstrip to use a common implementation.

Replaced the __note__ field of :exc:`BaseException` (added in an earlier version of 3.11) with the final design of PEP 678. Namely, :exc:`BaseException` gets an :meth:`add_note` method, and its __notes__ field is created when necessary.

Speed up right shift of negative integers, by removing unnecessary creation of temporaries. Original patch by Xinhang Xu, reworked by Mark Dickinson.

Make the interpreter's low-level tracing (lltrace) feature output more readable by displaying opcode names (rather than just numbers), and by displaying stack contents before each opcode.

Fixed an uninitialized bool value in the traceback printing code path that was introduced by the initial bpo-45292 exception groups work.

Fix a potential integer overflow in _Py_DecodeUTF8Ex.

Add static const char *const _PyOpcode_OpName[256] = {...}; to opcode.h for debug builds to assist in debugging the Python interpreter. It is now more convenient to make various forms of debugging output more human-readable by including opcode names rather than just the corresponding decimal digits.

Make :opcode:`POP_JUMP_IF_TRUE`, :opcode:`POP_JUMP_IF_FALSE`, :opcode:`POP_JUMP_IF_NONE` and :opcode:`POP_JUMP_IF_NOT_NONE` virtual, mapping to new relative jump opcodes.

Add internal documentation explaining design of new (for 3.11) frame stack.

ctypes used to mishandle void return types, so that for instance a function declared like ctypes.CFUNCTYPE(None, ctypes.c_int) would be called with signature int f(int) instead of void f(int). Wasm targets require function pointers to be called with the correct signatures so this led to crashes. The problem is now fixed.

Make opcodes :opcode:`!JUMP_IF_TRUE_OR_POP` and :opcode:`!JUMP_IF_FALSE_OR_POP` relative rather than absolute.

Replace the f_lasti member of the internal _PyInterpreterFrame structure with a prev_instr pointer, which reduces overhead in the main interpreter loop. The f_lasti attribute of Python-layer frame objects is preserved for backward-compatibility.

Integer mod/remainder operations, including the three-argument form of :func:`pow`, now consistently return ints from the global small integer cache when applicable.

Classes and functions that unconditionally declared their docstrings ignoring the --without-doc-strings compilation flag no longer do so.

The classes affected are :class:`ctypes.UnionType`, :class:`pickle.PickleBuffer`, :class:`testcapi.RecursingInfinitelyError`, and :class:`types.GenericAlias`.

The functions affected are 24 methods in :mod:`ctypes`.

Patch by Oleg Iarygin.

Use Argument Clinic for the :class:`types.MethodType` constructor. Patch by Oleg Iarygin.

Fix wrapping bound methods with @classmethod

Optimize :meth:`set.intersection` for non-set arguments.

Optimize :meth:`set.issuperset` for non-set argument.

Add type-specialized versions of the Py_DECREF(), and use them for float, int, str, bool, and None to avoid pointer-chasing at runtime where types are known at C compile time.

Do not use POSIX semaphores on NetBSD

Fix crashes in built-in encoders with error handlers that return position less or equal than the starting position of non-encodable characters.

marshal.dumps() uses FLAG_REF for all interned strings. This makes output more deterministic and helps reproducible build.

Added object.__getstate__ which provides the default implementation of the __getstate__() method.

Copying and pickling instances of subclasses of builtin types bytearray, set, frozenset, collections.OrderedDict, collections.deque, weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes implemented as slots.

Add the encoding parameter to :func:`os.popen`.

Fix an issue where :mod:`dis` utilities may interpret populated inline cache entries as valid instructions.

Deprecate :class:`typing.Text` (removal of the class is currently not planned). Patch by Alex Waygood.

Deprecate nested classes in enum definitions becoming members -- in 3.13 they will be normal classes; add member and nonmember functions to allow control over results now.

Fixed a performance regression in ctypes function calls.

Show the actual named values stored in inline caches when show_caches=True is passed to :mod:`dis` utilities.

Prefer close_range() to iterating over procfs for file descriptor closing in :mod:`subprocess` for better performance.

Sort the miscellaneous topics in Cmd.do_help()

Port socket.__init__ to Argument Clinic. Patch by Cinder.

Add support for generalized ISO 8601 parsing to :meth:`datetime.datetime.fromisoformat`, :meth:`datetime.date.fromisoformat` and :meth:`datetime.time.fromisoformat`. Patch by Paul Ganssle.

Fix a 3.11 regression in :func:`~contextlib.contextmanager`, which caused it to propagate exceptions with incorrect tracebacks.

Adding COPYFILE_STAT, COPYFILE_ACL and COPYFILE_XATTR constants for :func:`os.fcopyfile` available in macOs.

For :func:`@dataclass <dataclasses.dataclass>`, add weakref_slot. The new parameter defaults to False. If true, and if slots=True, add a slot named "__weakref__", which will allow instances to be weakref'd. Contributed by Eric V. Smith

New function os.login_tty() for Unix.

Add :meth:`~object.__class_getitem__` to :class:`logging.LoggerAdapter` and :class:`logging.StreamHandler`, allowing them to be parameterized at runtime. Patch by Alex Waygood.

Forbid pickling constants re._constants.SUCCESS etc. Previously, pickling did not fail, but the result could not be unpickled.

:class:`inspect.Parameter` now raises :exc:`ValueError` if name is a keyword, in addition to the existing check that it is an identifier.

Add an __unpacked__ attribute to :class:`types.GenericAlias`. Patch by Jelle Zijlstra.

Add support for generic :class:`typing.NamedTuple`.

New http.HTTPMethod enum to represent all the available HTTP request methods in a convenient way

Modified test strings in test_argparse.py to not contain trailing spaces before end of line.

Add encoding="locale" support to :meth:`TextIOWrapper.reconfigure`.

Add encoding and errors arguments to :func:`subprocess.getoutput` and :func:`subprocess.getstatusoutput`.

Always close the read end of the pipe used by :class:`multiprocessing.Queue` after the last write of buffered data to the write end of the pipe to avoid :exc:`BrokenPipeError` at garbage collection and at :meth:`multiprocessing.Queue.close` calls. Patch by Géry Ogam.

Add datetime.UTC alias for datetime.timezone.utc.

Patch by Kabir Kwatra.

The :mod:`!mailcap` module is now deprecated and will be removed in Python 3.13. See PEP 594 for the rationale and the :mod:`mimetypes` module for an alternative. Patch by Victor Stinner.

Provide a way to disable :mod:`subprocess` use of vfork() just in case it is ever needed and document the existing mechanism for posix_spawn().

Fix :const:`signal.NSIG` value on FreeBSD to accept signal numbers greater than 32, like :const:`signal.SIGRTMIN` and :const:`signal.SIGRTMAX`. Patch by Victor Stinner.

Add missing f prefix to f-strings in error messages from the :mod:`multiprocessing` and :mod:`asyncio` modules.

Add :func:`typing.dataclass_transform`, implementing PEP 681. Patch by Jelle Zijlstra.

Add required attribute to :class:`argparse.Action` repr output.

In the :mod:`tkinter` module add method info_patchlevel() which returns the exact version of the Tcl library as a named tuple similar to :data:`sys.version_info`.

Add :option:`--enable-wasm-pthreads` to enable pthreads support for WASM builds. Emscripten/node no longer has threading enabled by default. Include additional file systems.

Fix unstable test_from_tuple test in test_decimal.py.

Deprecate the xdrlib module.

Deprecate the uu module.

More strict rules will be applied for numerical group references and group names in regular expressions. For now, a deprecation warning is emitted for group references and group names which will be errors in future Python versions.

Add provisional :data:`sys._emscripten_info` named tuple with build-time and run-time information about Emscripten platform.

:func:`signal.raise_signal` and :func:`os.kill` now check immediately for pending signals. Patch by Victor Stinner.

Fix OSS audio support on Solaris.

Include the passed value in the exception thrown by :func:`typing.assert_never`. Patch by Jelle Zijlstra.

Compilation of regular expression containing a conditional expression (?(group)...) now raises an appropriate :exc:`re.error` if the group number refers to not defined group. Previously an internal RuntimeError was raised.

Add an optional keyword shutdown_timeout parameter to the :class:`multiprocessing.BaseManager` constructor. Kill the process if terminate() takes longer than the timeout. Patch by Victor Stinner.

Fix :func:`typing.get_type_hints` for :class:`collections.abc.Callable`. Patch by Shantanu Jain.

Parsing \N escapes of Unicode Named Character Sequences in a :mod:`regular expression <re>` raises now :exc:`re.error` instead of TypeError.

Remove deprecated SO config variable in :mod:`sysconfig`.

Deprecate the telnetlib module.

Deprecate the sunau module.

Deprecate the spwd module.

Deprecate the sndhdr module, as well as inline needed functionality for email.mime.MIMEAudio.

:mod:`re` module, fix :meth:`~re.Pattern.fullmatch` mismatch when using Atomic Grouping or Possessive Quantifiers.

Deprecate the 'pipes' module.

Deprecate the ossaudiodev module.

:mod:`re` module, limit the maximum capturing group to 1,073,741,823 in 64-bit build, this increases the depth of backtracking.

Deprecate the nis module.

Fix the comparison of character and integer inside :func:`Tools.gdb.libpython.write_repr`. Patch by Yu Liu.

Add option to raise all errors from :meth:`~socket.create_connection` in an :exc:`ExceptionGroup` when it fails to create a connection. The default remains to raise only the last error that had occurred when multiple addresses were tried.

Optimize asyncio UDP speed, over 100 times faster when transferring a large file.

Update case-insensitive matching in the :mod:`re` module to the latest Unicode version.

In concurrent.futures.process.ProcessPoolExecutor disallow the "fork" multiprocessing start method when the new max_tasks_per_child feature is used as the mix of threads+fork can hang the child processes. Default to using the safe "spawn" start method in that circumstance if no mp_context was supplied.

In :mod:`sqlite3`, SQLITE_MISUSE result codes are now mapped to :exc:`~sqlite3.InterfaceError` instead of :exc:`~sqlite3.ProgrammingError`. Also, more accurate exceptions are raised when binding parameters fail. Patch by Erlend E. Aasland.

Stop calling os.device_encoding(file.fileno()) in :class:`TextIOWrapper`. It was complex, never documented, and didn't work for most cases. (Patch by Inada Naoki.)

Change the frame-related functions in the :mod:`inspect` module to return a regular object (that is backwards compatible with the old tuple-like interface) that include the extended PEP 657 position information (end line number, column and end column). The affected functions are: :func:`inspect.getframeinfo`, :func:`inspect.getouterframes`, :func:`inspect.getinnerframes`, :func:`inspect.stack` and :func:`inspect.trace`. Patch by Pablo Galindo.

Add indexing and slicing support to :class:`sqlite3.Blob`. Patch by Aviv Palivoda and Erlend E. Aasland.

Add :term:`context manager` support to :class:`sqlite3.Blob`. Patch by Aviv Palivoda and Erlend E. Aasland.

Deprecate nntplib.

Deprecate msilib.

Improve the performance of :mod:`re` matching by using computed gotos (or "threaded code") on supported platforms and removing expensive pointer indirections.

Deprecate the imghdr module.

Deprecate the crypt module.

Make space for longer opcodes in :mod:`dis` output.

Make :class:`TextIOWrapper` uses locale encoding when encoding="locale" is specified even in UTF-8 mode.

:func:`warnings.catch_warnings` now accepts arguments for :func:`warnings.simplefilter`, providing a more concise way to locally ignore warnings or convert them to errors.

Deprecate the chunk module.

Add the TCP_CONNECTION_INFO option (available on macOS) to :mod:`socket`.

Fix os.closerange() potentially being a no-op in a Linux seccomp sandbox.

Implement typing.Required and typing.NotRequired (PEP 655). Patch by David Foster and Jelle Zijlstra.

Deprecate cgi and cgitb.

Deprecate audioop.

Add :func:`locale.getencoding` to get the current locale encoding. It is similar to locale.getpreferredencoding(False) but ignores the :ref:`Python UTF-8 Mode <utf8-mode>`.

Add :mod:`wsgiref.types`, containing WSGI-specific types for static type checking.

Suppress expression chaining for more :mod:`re` parsing errors.

Remove undocumented and never working function re.template() and flag re.TEMPLATE. This was later reverted in 3.11.0b2 and deprecated instead.

:meth:`decimal.localcontext` now accepts context attributes via keyword arguments

Fix errors in the :mod:`email` module if the charset itself contains undecodable/unencodable characters.

Disassembly of quickened code.

Forward gzip.compress() compresslevel to zlib.

Add :func:`typing.get_overloads` and :func:`typing.clear_overloads`. Patch by Jelle Zijlstra.

:class:`typing.Protocol` no longer silently replaces :meth:`__init__` methods defined on subclasses. Patch by Adrian Garcia Badaracco.

Fix :class:`concurrent.futures.ProcessPoolExecutor` exception memory leak

Add support for path-like objects to :func:`multiprocessing.set_executable` for Windows to be on a par with Unix-like systems. Patch by Géry Ogam.

Add SO_INCOMING_CPU constant to :mod:`socket`.

Fix OSS audio support on NetBSD.

image/avif and image/webp were added to :mod:`mimetypes`.

Add command-line option -p/--protocol to module :mod:`http.server` which specifies the HTTP version to which the server is conformant (HTTP/1.1 conformant servers can now be run from the command-line interface of module :mod:`http.server`). Patch by Géry Ogam.

Accept ellipsis as the last argument of :data:`typing.Concatenate`.

Remove variables leaking into pydoc.Helper class namespace.

Fix ipaddress.ip_{address,interface,network} raising TypeError instead of ValueError if given invalid tuple as address parameter.

CookieJar with DefaultCookiePolicy now can process cookies from localhost with domain=localhost explicitly specified in Set-Cookie header.

Add a "z" option to the string formatting specification that coerces negative zero floating-point values to positive zero after rounding to the format precision. Contributed by John Belmonte.

Fully implement the :class:`io.BufferedIOBase` or :class:`io.TextIOBase` interface for :class:`tempfile.SpooledTemporaryFile` objects. This lets them work correctly with higher-level layers (like compression modules). Patch by Carey Metcalfe.

Fix a regression in the :mod:`sqlite3` trace callback where bound parameters were not expanded in the passed statement string. The regression was introduced in Python 3.10 by :issue:`40318`. Patch by Erlend E. Aasland.

Allow :class:`~typing.TypedDict` subclasses to also include :class:`~typing.Generic` as a base class in class based syntax. Thereby allowing the user to define a generic TypedDict, just like a user-defined generic but with TypedDict semantics.

Fix BooleanOptionalAction to not automatically add a default string. If a default string is desired, use a formatter to add it.

All positional-or-keyword parameters to ABCMeta.__new__ are now positional-only to avoid conflicts with keyword arguments to be passed to :meth:`__init_subclass__`.

Prevent creation of a venv whose path contains the PATH separator. This could affect the usage of the activate script. Patch by Dustin Rodrigues.

Add a process_group parameter to :class:`subprocess.Popen` to help move more things off of the unsafe preexec_fn parameter.

Fix cookies getting sorted in :func:`CookieJar.__iter__` which is an extra behavior and not mentioned in RFC 2965 or Netscape cookie protocol. Now the cookies in CookieJar follows the order of the Set-Cookie header. Patch by Iman Kermani.

Add :meth:`~sqlite3.Connection.create_window_function` to :class:`sqlite3.Connection` for creating aggregate window functions. Patch by Erlend E. Aasland.

Convert :mod:`csv` to use Argument Clinic for :func:`csv.field_size_limit`, :func:`csv.get_dialect`, :func:`csv.unregister_dialect` and :func:`csv.list_dialects`.

Raise an ArgumentError when the same subparser name is added twice to an argparse.ArgumentParser. This is consistent with the (default) behavior when the same option string is added twice to an ArgumentParser.

Raise :exc:`~sqlite3.ProgrammingError` instead of segfaulting on recursive usage of cursors in :mod:`sqlite3` converters. Patch by Sergey Fedoseev.

Adds a start_tls() method to :class:`~asyncio.streams.StreamWriter`, which upgrades the connection with TLS using the given :class:`~ssl.SSLContext`.

:class:`~pathlib.Path` methods :meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only directories if pattern ends with a pathname components separator (/ or :data:`~os.sep`). Patch by Eisuke Kawashima.

Add :meth:`~sqlite3.Connection.blobopen` to :class:`sqlite3.Connection`. :class:`sqlite3.Blob` allows incremental I/O operations on blobs. Patch by Aviv Palivoda and Erlend E. Aasland.

Add a new gh role to the documentation to link to GitHub issues.

Document security issues concerning the use of the function :meth:`shutil.unpack_archive`

Remove "Undocumented modules" page.

In importlib.resources.abc, refined the documentation of the Traversable Protocol, applying changes from importlib_resources 5.7.1.

Clarify the meaning of dirs_exist_ok, a kwarg of :func:`shutil.copytree`.

Remove 'make -C Doc serve' in favour of 'make -C Doc htmlview'

Add a What's New in Python 3.11 entry for the Faster CPython project. Documentation by Ken Jin and Kumar Aditya.

Update the introduction to documentation for :mod:`os.path` to remove warnings that became irrelevant after the implementations of PEP 383 and PEP 529.

The documentation now lists which members of C structs are part of the :ref:`Limited API/Stable ABI <stable>`.

All docstrings in code snippets are now wrapped into :c:macro:`PyDoc_STR` to follow the guideline of :pep:`PEP 7's Documentation Strings paragraph <0007#documentation-strings>`. Patch by Oleg Iarygin.

Improve the docstrings of :func:`runpy.run_module` and :func:`runpy.run_path`. Original patch by Andrew Brezovsky.

Use warnings_helper.import_deprecated() to import deprecated modules uniformly in tests. Patch by Hugo van Kemenade.

When multiprocessing is enabled, libregrtest can now use a Python executable other than sys.executable via the --python flag.

Fix initialization of :envvar:`PYTHONREGRTEST_UNICODE_GUARD` which prevented running regression tests on non-UTF-8 locale.

Added @requires_zlib to test.test_tools.test_freeze.TestFreeze.

Fix test_concurrent_futures to test the correct multiprocessing start method context in several cases where the test logic mixed this up.

Threading tests are now skipped on WASM targets without pthread support.

Test for :mod:`ctypes.macholib.dyld`, :mod:`ctypes.macholib.dylib`, and :mod:`ctypes.macholib.framework` are brought from manual pre-:mod:`unittest` times to :mod:`ctypes.test` location and structure. Patch by Oleg Iarygin.

Add tests for :class:`ipaddress.IPv4Interface` and :class:`ipaddress.IPv6Interface` construction with tuple arguments. Original patch and tests by louisom.

gdbm-compat is now preferred over ndbm if both are available on the system. This allows avoiding the problematic ndbm.h on macOS.

Python is now built with -std=c11 compiler option, rather than -std=c99. Patch by Victor Stinner.

Add script and make target for generating sre_constants.h.

Windows PGInstrument builds now copy a required DLL into the output directory, making it easier to run the profile stage of a PGO build.

Update Windows installer to use SQLite 3.38.3.

Fixed --list and --list-paths output for :ref:`launcher` when used in an active virtual environment.

Update Windows installer to use SQLite 3.38.2.

Fix race condition between :func:`os.stat` and unlinking a file on Windows, by using errors codes returned by FindFirstFileW() when appropriate in win32_xstat_impl.

Update Windows build to use xz-5.2.5

Update macOS installer to SQLite 3.38.4.

Fix regression in the code generated by Argument Clinic for functions with the defining_class parameter.

Add script Tools/scripts/generate_re_casefix.py and the make target regen-re for generating additional data for case-insensitive matching according to the current Unicode version.

Remove the ancient Pynche color editor. It has moved to https://gitlab.com/warsaw/pynche

Deprecate the C functions: :c:func:`!PySys_SetArgv`, :c:func:`!PySys_SetArgvEx`, :c:func:`!PySys_SetPath`. Patch by Victor Stinner.

Added the :c:func:`PyCode_GetCode` function. This function does the equivalent of the Python code getattr(code_object, 'co_code').

Fix the closure argument to :c:func:`PyEval_EvalCodeEx`.

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++. Patch by Victor Stinner.

Mark functions as deprecated by PEP 623: :c:func:`!PyUnicode_AS_DATA`, :c:func:`!PyUnicode_AS_UNICODE`, :c:func:`!PyUnicode_GET_DATA_SIZE`, :c:func:`!PyUnicode_GET_SIZE`. Patch by Victor Stinner.

:c:func:`Py_REFCNT`, :c:func:`Py_TYPE`, :c:func:`Py_SIZE` and :c:func:`Py_IS_TYPE` functions argument type is now PyObject*, rather than const PyObject*. Patch by Victor Stinner.

Add PyBytes_Type.tp_alloc to initialize PyBytesObject.ob_shash for bytes subclasses.

Add PyFrame_GetLasti C-API function to access frame object's f_lasti attribute safely from C code.

Remove the Include/code.h header file. C extensions should only include the main <Python.h> header file. Patch by Victor Stinner.

:c:func:`PyOS_CheckStack` is now exported in the Stable ABI on Windows.

:c:func:`PyThread_get_thread_native_id` is excluded from the stable ABI on platforms where it doesn't exist (like Solaris).

Added :c:func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException` as simpler alternatives to :c:func:`PyErr_GetExcInfo` and :c:func:`PyErr_SetExcInfo`.

They are included in the stable ABI.