All Versions
29
Latest Version
Avg Release Cycle
168 days
Latest Release
218 days ago

Changelog History
Page 1

  • v3.0.1 Changes

    November 03, 2022

    ➕ Added

    • 👍 Support for Python 3.11

    🔄 Changed

    • Allow decoders to override conversion of types derived from primitive types

    🛠 Fixed

    • 🚚 Fixed objects leaking when Python attached event handlers to them even if they were later removed
    • 🛠 Fixed PyInt conversion to BigInteger and System.String produced incorrect result for values between 128 and 255.
    • 🛠 Fixed implementing a generic interface with a Python class
  • v3.0.0 Changes

    September 29, 2022

    ➕ Added

    • Ability to instantiate new .NET arrays using Array[T](dim1, dim2, ...) syntax
    • 👍 Python operator method will call C# operator method for supported binary and unary operators ([#1324][p1324]).
    • Add GetPythonThreadID and Interrupt methods in PythonEngine
    • Ability to implement delegates with ref and out parameters in Python, by returning the modified parameter values in a tuple. ([#1355][i1355])
    • Ability to override .NET methods that have out or ref in Python by returning the modified parameter values in a tuple. ([#1481][i1481])
    • PyType - a wrapper for Python type objects, that also permits creating new heap types from TypeSpec
    • 👻 Improved exception handling:
      • exceptions can now be converted with codecs
      • InnerException and __cause__ are propagated properly
    • __name__ and __signature__ to reflected .NET methods
    • .NET collection types now implement standard Python collection interfaces from collections.abc. 👀 See [Mixins/collections.py](src/runtime/Mixins/collections.py).
    • you can cast objects to generic .NET interfaces without specifying generic arguments as long as there is no ambiguity.
    • .NET arrays implement Python buffer protocol
    • Python integer interoperability with System.Numerics.BigInteger
    • Python.NET will correctly resolve .NET methods, that accept PyList, PyInt, and other PyObject derived types when called from Python.
    • .NET classes, that have __call__ method are callable from Python
    • PyIterable type, that wraps any iterable object in Python
    • 👍 PythonEngine properties for supported Python versions: MinSupportedVersion, MaxSupportedVersion, and IsSupportedVersion
    • 🔧 The runtime that is loaded on import clr can now be configured via environment variables

    🔄 Changed

    • 👍 Drop support for Python 2, 3.4, 3.5, and 3.6
    • wchar_t size aka Runtime.UCS is now determined at runtime
    • clr.AddReference may now throw errors besides FileNotFoundException, that provide more details about the cause of the failure
    • clr.AddReference no longer adds ".dll" implicitly
    • PyIter(PyObject) constructor replaced with static PyIter.GetIter(PyObject) method
    • Python runtime can no longer be shut down if the Python error indicator is set, as it would have unpredictable behavior
    • BREAKING: Return values from .NET methods that return an interface are now automatically wrapped in that interface. This is a breaking change for users that rely on being able to access members that are part of the implementation class, but not the interface. Use the new __implementation__ or __raw_implementation__ properties to if you need to "downcast" to the implementation class.
    • BREAKING: == and != operators on PyObject instances now use Python comparison (previously was equivalent to object.ReferenceEquals(,))
    • BREAKING: Parameters marked with ParameterAttributes.Out are no longer returned in addition to the regular method return value (unless they are passed with ref or out keyword).
    • 🗄 BREAKING: Drop support for the long-deprecated CLR.* prefix.
    • PyObject now implements IEnumerable<PyObject> in addition to IEnumerable
    • floating point values passed from Python are no longer silently truncated when .NET expects an integer [#1342][i1342]
    • More specific error messages for method argument mismatch
    • members of PyObject inherited from System.Object andDynamicObject` now autoacquire GIL
    • BREAKING: when inheriting from .NET types in Python if you override __init__ you must explicitly call base constructor using super().__init__(.....). Not doing so will lead to undefined behavior.
    • BREAKING: most PyScope methods will never return null. Instead, PyObject None will be returned.
    • BREAKING: PyScope was renamed to PyModule
    • BREAKING: Methods with ref or out parameters and void return type return a tuple of only the ref and out parameters.
    • BREAKING: to call Python from .NET Runtime.PythonDLL property must be set to Python DLL name or the DLL must be loaded in advance. This must be done before calling any other Python.NET functions.
    • 👍 BREAKING: PyObject.Length() now raises a PythonException when object does not support a concept of length.
    • BREAKING: disabled implicit conversion from C# enums to Python int and back. One must now either use enum members (e.g. MyEnum.Option), or use enum constructor (e.g. MyEnum(42) or MyEnum(42, True) when MyEnum does not have a member with value 42).
    • BREAKING: disabled implicit conversion from Python objects implementing sequence protocol to .NET arrays when the target .NET type is System.Object. The conversion is still attempted when the target type is a System.Array.
    • Sign Runtime DLL with a strong name
    • Implement loading through clr_loader instead of the included ClrModule, enables support for .NET Core
    • BREAKING: .NET and Python exceptions are preserved when crossing Python/.NET boundary
    • BREAKING: custom encoders are no longer called for instances of System.Type
    • PythonException.Restore no longer clears PythonException instance.
    • Replaced the old __import__ hook hack with a PEP302-style Meta Path Loader
    • BREAKING: Names of .NET types (e.g. str(__class__)) changed to better support generic types
    • BREAKING: overload resolution will no longer prefer basic types. Instead, first matching overload will be chosen.
    • BREAKING: acquiring GIL using Py.GIL no longer forces PythonEngine to initialize
    • BREAKING: Exec and Eval from PythonEngine no longer accept raw pointers.
    • BREAKING: .NET collections and arrays are no longer automatically converted to Python collections. Instead, they implement standard Python collection interfaces from collections.abc. 👀 See [Mixins/collections.py](src/runtime/Mixins/collections.py).
    • BREAKING: When trying to convert Python int to System.Object, result will be of type PyInt instead of System.Int32 due to possible loss of information. Python float will continue to be converted to System.Double.
    • BREAKING: Python.NET will no longer implicitly convert types like numpy.float64, that implement __float__ to System.Single and System.Double. An explicit conversion is required on Python or .NET side.
    • BREAKING: PyObject.GetHashCode can fail.
    • BREAKING: Python.NET will no longer implicitly convert any Python object to System.Boolean.
    • 0️⃣ BREAKING: PyObject.GetAttr(name, default) now only ignores AttributeError (previously ignored all exceptions).
    • BREAKING: PyObject no longer implements IEnumerable<PyObject>. Instead, PyIterable does that.
    • BREAKING: IPyObjectDecoder.CanDecode objectType parameter type changed from PyObject to PyType

    🛠 Fixed

    • Fix incorrect dereference of wrapper object in tp_repr, which may result in a program crash
    • 🛠 Fixed parameterless .NET constructor being silently called when a matching constructor overload is not found ([#238][i238])
    • Fix incorrect dereference in params array handling
    • 🛠 Fixes issue with function resolution when calling overloaded function with keyword arguments from python ([#1097][i1097])
    • Fix object[] parameters taking precedence when should not in overload resolution
    • 🛠 Fixed a bug where all .NET class instances were considered Iterable
    • Fix incorrect choice of method to invoke when using keyword arguments.
    • Fix non-delegate types incorrectly appearing as callable.
    • Indexers can now be used with interface objects
    • 🛠 Fixed a bug where indexers could not be used if they were inherited
    • Made it possible to use __len__ also on ICollection<> interface objects
    • 🛠 Fixed issue when calling PythonException.Format where another exception would be raise for unnormalized exceptions
    • Made it possible to call ToString, GetHashCode, and GetType on inteface objects
    • 🛠 Fixed objects returned by enumerating PyObject being disposed too soon
    • Incorrectly using a non-generic type with type parameters now produces a helpful Python error instead of throwing NullReferenceException
    • 🚩 import may now raise errors with more detail than "No module named X"
    • 👻 Exception stacktraces on PythonException.StackTrace are now properly formatted
    • Providing an invalid type parameter to a generic type or method produces a helpful Python error
    • Empty parameter names (as can be generated from F#) do not cause crashes
    • Unicode strings with surrogates were truncated when converting from Python
    • 👀 Reload mode now supports generic methods (previously Python would stop seeing them after reload)
    • 🛠 Temporarily fixed issue resolving method overload when method signature has out parameters ([#1672](i1672))
    • 0️⃣ Decimal default parameters are now correctly taken into account

    ✂ Removed

    • 🚚 ShutdownMode has been removed. The only shutdown mode supported now is an equivalent of ShutdownMode.Reload. There is no need to specify it.
    • implicit assembly loading (you have to explicitly clr.AddReference before doing import)
    • 👻 messages in PythonException no longer start with exception type
    • PyScopeManager, PyScopeException, PyScope (use PyModule instead)
    • 👍 support for .NET Framework 4.0-4.6; Mono before 5.4. Python.NET now requires .NET Standard 2.0 👀 (see the matrix)
  • v2.5.2 Changes

    February 05, 2021

    🛠 Bugfix release.

    🛠 Fixed

    • Fix object[] parameters taking precedence when should not in overload resolution
    • Empty parameter names (as can be generated from F#) do not cause crashes
  • v2.5.1 Changes

    June 18, 2020

    🛠 Backports two reference counting bugfixes from master.

    🛠 Many thanks two the reporters who also provided the fixes:

  • v2.5.0 Changes

    June 14, 2020

    🚀 > ⚠️ This release will be the last one supporting Python 2 and non-.NET-Standard builds.

    🐎 This version improves performance on benchmarks significantly compared to 2.3 and includes various additions and improvements to the library.

    ➕ Added

    • 🏗 Automatic NuGet package generation in appveyor and local builds
    • Function that sets Py_NoSiteFlag to 1.
    • 👌 Support for Jetson Nano.
    • Support for __len__ for .NET classes that implement ICollection
    • PyExport attribute to hide .NET types from Python
    • PythonException.Format method to format exceptions the same as
      traceback.format_exception
    • Runtime.None to be able to pass None as parameter into Python from .NET
    • PyObject.IsNone() to check if a Python object is None in .NET.
    • 👌 Support for Python 3.8
    • Codecs as the designated way to handle automatic conversions between
      .NET and Python types

    🔄 Changed

    • ➕ Added argument types information to "No method matches given arguments" message
    • 🚚 Moved wheel import in setup.py inside of a try/except to prevent pip collection failures
    • Removes PyLong_GetMax and PyClass_New when targetting Python3
    • 👌 Improved performance of calls from Python to C#
    • ➕ Added support for converting python iterators to C# arrays
    • 🔄 Changed usage of the obsolete function
      GetDelegateForFunctionPointer(IntPtr, Type) to
      GetDelegateForFunctionPointer<TDelegate>(IntPtr)
    • When calling C# from Python, enable passing argument of any type to a
      parameter of C# type object by wrapping it into PyObject instance.
      ([#881][i881])
    • ➕ Added support for kwarg parameters when calling .NET methods from Python
    • 🔄 Changed method for finding MSBuild using vswhere
    • Reworked Finalizer. Now objects drop into its queue upon finalization,
      which is periodically drained when new objects are created.
    • Marked Runtime.OperatingSystemName and Runtime.MachineName as
      Obsolete, should never have been public in the first place. They also
      don't necessarily return a result that matches the platform module's.
    • 📜 Unconditionally depend on pycparser for the interop module generation

    🛠 Fixed

    • 🛠 Fixed runtime that fails loading when using pythonnet in an environment
      together with Nuitka
    • 🛠 Fixes bug where delegates get casts (dotnetcore)
    • Determine size of interpreter longs at runtime
    • Handling exceptions ocurred in ModuleObject's getattribute
    • Fill __classcell__ correctly for Python subclasses of .NET types
    • 🛠 Fixed issue with params methods that are not passed an array.
    • 👉 Use UTF8 to encode strings passed to PyRun_String on Python 3

    Acknowledgements

    🚀 These authors have contributed to this release:

  • v2.5.0-rc2 Changes

    June 07, 2020

    🐎 This version improves performance on benchmarks significantly compared to 2.3.

    ➕ Added

    • 🏗 Automatic NuGet package generation in appveyor and local builds
    • Function that sets Py_NoSiteFlag to 1.
    • 👍 Support for Jetson Nano.
    • Support for __len__ for .NET classes that implement ICollection
    • PyExport attribute to hide .NET types from Python
    • PythonException.Format method to format exceptions the same as traceback.format_exception
    • Runtime.None to be able to pass None as parameter into Python from .NET
    • PyObject.IsNone() to check if a Python object is None in .NET.
    • 👍 Support for Python 3.8
    • Codecs as the designated way to handle automatic conversions between .NET and Python types

    🔄 Changed

    • Added argument types information to "No method matches given arguments" message
    • 🚚 Moved wheel import in setup.py inside of a try/except to prevent pip collection failures
    • Removes PyLong_GetMax and PyClass_New when targetting Python3
    • 🐎 Improved performance of calls from Python to C#
    • 👍 Added support for converting python iterators to C# arrays
    • Changed usage of the obsolete function GetDelegateForFunctionPointer(IntPtr, Type) to GetDelegateForFunctionPointer<TDelegate>(IntPtr)
    • When calling C# from Python, enable passing argument of any type to a parameter of C# type object by wrapping it into PyObject instance. ([#881][i881])
    • 👍 Added support for kwarg parameters when calling .NET methods from Python
    • Changed method for finding MSBuild using vswhere
    • Reworked Finalizer. Now objects drop into its queue upon finalization, which is periodically drained when new objects are created.
    • Marked Runtime.OperatingSystemName and Runtime.MachineName as Obsolete, should never have been public in the first place. They also don't necessarily return a result that matches the platform module's.

    🛠 Fixed

    • 🛠 Fixed runtime that fails loading when using pythonnet in an environment together with Nuitka
    • 🛠 Fixes bug where delegates get casts (dotnetcore)
    • Determine size of interpreter longs at runtime
    • Handling exceptions ocurred in ModuleObject's getattribute
    • Fill __classcell__ correctly for Python subclasses of .NET types
    • 🛠 Fixed issue with params methods that are not passed an array.
    • Use UTF8 to encode strings passed to PyRun_String on Python 3
  • v2.5.0-rc1

    May 18, 2020
  • v2.4.0 Changes

    May 03, 2019

    ➕ Added

    • 👍 Added support for embedding python into dotnet core 2.0 (NetStandard 2.0)
    • 👷 Added new build system (pythonnet.15.sln) based on dotnetcore-sdk/xplat(crossplatform msbuild). Currently there two side-by-side build systems that produces the same output (net40) from the same sources. After a some transition time, current (mono/ msbuild 14.0) build system will be removed.
    • ⬆️ NUnit upgraded to 3.7 (eliminates travis-ci random bug)
    • Added C# PythonEngine.AddShutdownHandler to help client code clean up on shutdown.
    • Added clr.GetClrType ([#432][i432])([#433][p433])
    • Allowed passing None for nullable args ([#460][p460])
    • Added keyword arguments based on C# syntax for calling CPython methods ([#461][p461])
    • Catches exceptions thrown in C# iterators (yield returns) and rethrows them in python ([#475][i475])([#693][p693])
    • Implemented GetDynamicMemberNames() for PyObject to allow dynamic object members to be visible in the debugger ([#443][i443])([#690][p690])
    • 💅 Incorporated reference-style links to issues and pull requests in the CHANGELOG ([#608][i608])
    • 👍 Added PyObject finalizer support, Python objects referred by C# can be auto collect now ([#692][p692]).
    • Added detailed comments about aproaches and dangers to handle multi-app-domains ([#625][p625])
    • 🏗 Python 3.7 support, builds and testing added. Defaults changed from Python 3.6 to 3.7 ([#698][p698])
    • Added support for C# types to provide __repr__ ([#680][p680])

    🔄 Changed

    • PythonException included C# call stack
    • 👻 Reattach python exception traceback information (#545)
    • 🎉 PythonEngine.Intialize will now call Py_InitializeEx with a default value of 0, so signals will not be configured by default on embedding. This is different from the previous behaviour, where Py_Initialize was called instead, which sets initSigs to 1. ([#449][i449])
    • 🔨 Refactored MethodBinder.Bind in preparation to make it extensible (#829)
    • When calling C# from Python, enable passing argument of any type to a parameter of C# type object by wrapping it into PyObject instance. ([#881][i881])
    • 🏁 Look for installed Windows 10 sdk's during installation instead of relying on specific versions.

    🛠 Fixed

    • 🛠 Fixed secondary PythonEngine.Initialize call, all sensitive static variables now reseted. This is a hidden bug. Once python cleaning up enough memory, objects from previous engine run becomes corrupted. ([#534][p534])
    • 🛠 Fixed Visual Studio 2017 compat ([#434][i434]) for setup.py
    • 🛠 Fixed crashes when integrating pythonnet in Unity3d ([#714][i714]), related to unloading the Application Domain
    • Fixed interop methods with Py_ssize_t. NetCoreApp 2.0 is more sensitive than net40 and requires this fix. ([#531][p531])
    • 🛠 Fixed crash on exit of the Python interpreter if a python class derived from a .NET class has a __namespace__ or __assembly__ attribute ([#481][i481])
    • 🛠 Fixed conversion of 'float' and 'double' values ([#486][i486])
    • 🛠 Fixed 'clrmethod' for python 2 ([#492][i492])
    • 🛠 Fixed double calling of constructor when deriving from .NET class ([#495][i495])
    • 🛠 Fixed clr.GetClrType when iterating over System members ([#607][p607])
    • 🛠 Fixed LockRecursionException when loading assemblies ([#627][i627])
    • 🛠 Fixed errors breaking .NET Remoting on method invoke ([#276][i276])
    • 🛠 Fixed PyObject.GetHashCode ([#676][i676])
    • Fix memory leaks due to spurious handle incrementation ([#691][i691])
    • Fix spurious assembly loading exceptions from private types ([#703][i703])
    • Fix inheritance of non-abstract base methods ([#755][i755])
  • v2.4.0-rc2

    April 07, 2019
  • v2.4.0-rc1 Changes

    March 06, 2019

    ➕ Added

    • ➕ Added support for embedding python into dotnet core 2.0 (NetStandard 2.0)
    • ➕ Added new build system (pythonnet.15.sln) based on dotnetcore-sdk/xplat(crossplatform msbuild).
      👷 Currently there two side-by-side build systems that produces the same output (net40) from the same sources.
      👷 After a some transition time, current (mono/ msbuild 14.0) build system will be removed.
    • ⬆️ NUnit upgraded to 3.7 (eliminates travis-ci random bug)
    • ➕ Added C# PythonEngine.AddShutdownHandler to help client code clean up on shutdown.
    • ➕ Added clr.GetClrType (#432)(#433)
    • 👍 Allowed passing None for nullable args (#460)
    • ➕ Added keyword arguments based on C# syntax for calling CPython methods (#461)
    • Catches exceptions thrown in C# iterators (yield returns) and rethrows them in python (#475)(#693)
    • Implemented GetDynamicMemberNames() for PyObject to allow dynamic object members to be visible in the debugger (#443)(#690)
    • 💅 Incorporated reference-style links to issues and pull requests in the CHANGELOG (#608)
    • ➕ Added detailed comments about aproaches and dangers to handle multi-app-domains (#625)
    • 🏗 Python 3.7 support, builds and testing added. Defaults changed from Python 3.6 to 3.7 ([#698][p698])

    🔄 Changed

    • 👻 Reattach python exception traceback information (#545)
    • 🎉 PythonEngine.Intialize will now call Py_InitializeEx with a default value of 0, so signals will not be configured by default on embedding. This is different from the previous behaviour, where Py_Initialize was called instead, which sets initSigs to 1. (#449)

    🛠 Fixed

    • 🛠 Fixed secondary PythonEngine.Initialize call, all sensitive static variables now reseted.
      This is a hidden bug. Once python cleaning up enough memory, objects from previous engine run becomes corrupted. (#534)
    • 🛠 Fixed Visual Studio 2017 compat (#434) for setup.py
    • 🛠 Fixed crashes when integrating pythonnet in Unity3d (#714),
      related to unloading the Application Domain
    • Fixed interop methods with Py_ssize_t. NetCoreApp 2.0 is more sensitive than net40 and requires this fix. (#531)
    • 🛠 Fixed crash on exit of the Python interpreter if a python class
      derived from a .NET class has a __namespace__ or __assembly__
      attribute (#481)
    • 🛠 Fixed conversion of 'float' and 'double' values (#486)
    • 🛠 Fixed 'clrmethod' for python 2 (#492)
    • 🛠 Fixed double calling of constructor when deriving from .NET class (#495)
    • 🛠 Fixed clr.GetClrType when iterating over System members (#607)
    • 🛠 Fixed LockRecursionException when loading assemblies (#627)
    • 🛠 Fixed errors breaking .NET Remoting on method invoke (#276)
    • 🛠 Fixed PyObject.GetHashCode (#676)
    • 🛠 Fix memory leaks due to spurious handle incrementation ([#691][i691])
    • 🛠 Fix spurious assembly loading exceptions from private types ([#703][i703])
    • 🛠 Fix inheritance of non-abstract base methods (#755)