| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,10 +9,25 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. | |||
| 9 | 9 | ||
| 10 | 10 | ### Added | |
| 11 | 11 | ||
| 12 | + - Support for Python 3.15 (#2729) | ||
| 13 | + - Support for free-threaded Python 3.14 (`Py_GIL_DISABLED`) (#2721) | ||
| 14 | + - Threading documentation covering GIL ownership, managed threads, and | ||
| 15 | + free-threaded Python (#2721) | ||
| 16 | + | ||
| 12 | 17 | ### Changed | |
| 13 | 18 | ||
| 19 | + - Raise the minimum supported Python version from 3.10 to 3.11 (#2729) | ||
| 20 | + - Make runtime caches and CLR type binding safe for concurrent access (#2721) | ||
| 21 | + - Migrate the Visual Studio solution to the `.slnx` format (#2733) | ||
| 22 | + - Update GitHub Actions dependencies (#2739) | ||
| 23 | + | ||
| 14 | 24 | ### Fixed | |
| 15 | 25 | ||
| 26 | + - Fix races in finalization, buffer disposal, assembly path updates, and | ||
| 27 | + Python subclass creation (#2721) | ||
| 28 | + - Fix method binding initialization when methods are first accessed (#2721) | ||
| 29 | + - Fix wheel and NuGet preview package builds | ||
| 30 | + | ||
| 16 | 31 | ## 3.1.0 - 2026-05-23 | |
| 17 | 32 | ||
| 18 | 33 | ### Added | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,8 +23,9 @@ speeds for Python code. If you are interested in a pure managed-code | |||
| 23 | 23 | implementation of the Python language, you should check out the | |
| 24 | 24 | `IronPython`_ project. | |
| 25 | 25 | ||
| 26 | - Python.NET is currently compatible and tested with Python releases from 3.7 | ||
| 27 | - onwards. | ||
| 26 | + Python.NET is currently compatible and tested with Python releases 3.11 | ||
| 27 | + through 3.15. Free-threaded CPython is supported starting with Python 3.14; | ||
| 28 | + see :doc:`threading` for the threading and GIL guidance. | ||
| 28 | 29 | ||
| 29 | 30 | Current releases are available on `PyPi <https://pypi.org/project/pythonnet/>`_ | |
| 30 | 31 | and `Nuget.org <https://nuget.org/packages/pythonnet>`_. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -481,7 +481,7 @@ Python idioms: | |||
| 481 | 481 | name = item.GetName() | |
| 482 | 482 | ||
| 483 | 483 | Using Context Managers (IDisposable) | |
| 484 | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 484 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 485 | 485 | ||
| 486 | 486 | .NET types that implement ``IDisposable`` can be used with Python's context manager | |
| 487 | 487 | protocol using the standard ``with`` statement. This automatically calls the object's | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,8 +3,10 @@ Threading | |||
| 3 | 3 | ||
| 4 | 4 | This page explains how Python.NET interacts with the Python Global Interpreter | |
| 5 | 5 | Lock (GIL) and with managed threads, and what guarantees the runtime makes | |
| 6 | - when your code is multi-threaded. It covers both classic CPython builds and | ||
| 7 | - the free-threaded build introduced in CPython 3.13 (``Py_GIL_DISABLED``). | ||
| 6 | + when your code is multi-threaded. It covers classic CPython builds for Python | ||
| 7 | + 3.11 through 3.15 and the free-threaded builds introduced in CPython 3.13 | ||
| 8 | + (``Py_GIL_DISABLED``). Python.NET supports free-threaded CPython starting with | ||
| 9 | + Python 3.14. | ||
| 8 | 10 | ||
| 9 | 11 | The model in one paragraph | |
| 10 | 12 | -------------------------- | |
@@ -180,17 +182,18 @@ If you start a managed thread while holding the GIL and the thread needs to | |||
| 180 | 182 | call back into Python, release the GIL first so the new thread can acquire | |
| 181 | 183 | it:: | |
| 182 | 184 | ||
| 185 | + IntPtr threadState; | ||
| 183 | 186 | using (Py.GIL()) | |
| 184 | 187 | { | |
| 185 | 188 | var pyCallback = scope.Get("on_done"); | |
| 186 | - PythonEngine.BeginAllowThreads(); // let workers acquire the GIL | ||
| 189 | + threadState = PythonEngine.BeginAllowThreads(); // let workers acquire the GIL | ||
| 187 | 190 | try | |
| 188 | 191 | { | |
| 189 | 192 | // spawn workers, wait for them... | |
| 190 | 193 | } | |
| 191 | 194 | finally | |
| 192 | 195 | { | |
| 193 | - PythonEngine.EndAllowThreads(...); | ||
| 196 | + PythonEngine.EndAllowThreads(threadState); | ||
| 194 | 197 | } | |
| 195 | 198 | } | |
| 196 | 199 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,6 @@ classifiers = [ | |||
| 20 | 20 | "Intended Audience :: Developers", | |
| 21 | 21 | "Programming Language :: C#", | |
| 22 | 22 | "Programming Language :: Python :: 3", | |
| 23 | - "Programming Language :: Python :: 3.10", | ||
| 24 | 23 | "Programming Language :: Python :: 3.11", | |
| 25 | 24 | "Programming Language :: Python :: 3.12", | |
| 26 | 25 | "Programming Language :: Python :: 3.13", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments