PythonNet v2.5.1 Release Notes

Release Date: 2020-06-18 // over 2 years ago
  • ๐Ÿ›  Backports two reference counting bugfixes from master.

    ๐Ÿ›  Many thanks two the reporters who also provided the fixes:

Previous changes from v2.5.0

  • ๐Ÿš€ > โš ๏ธ 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
    • 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 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
    • When calling C# from Python, enable passing argument of any type to a
      parameter of C# type object by wrapping it into PyObject instance.
    • โž• 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


    ๐Ÿš€ These authors have contributed to this release: