pythonnet v1.0.0-beta.1 Release Notes

  • ๐Ÿ”„ Changed

    • Added the baseline of the managed embedding API. Some of the details are still subject to change based on some real-world use and feedback.

      The embedding API is based on the PyObject class, along with a number of specific PyDict, PyList, (etc.) classes that expose the respective interfaces of the built-in Python types. The basic structure and usage is intended be familar to anyone who has used Python / C++ wrapper libraries like CXX or Boost.

    • โœ… Started integrating NUnit2 to support unit tests for the embedding layer - still need to add the embedding tests (many already exist, but were written for an older version of NUnit).

    • ๐Ÿ‘ Added Python iteration protocol support for arrays and managed objects that implement IEnumerable. This means that you can now use the Python idiom for item in object: on any array or IEnumerable object.

    • Added automatic conversion from Python sequence types to managed array types. This means, for example, that you can now call a managed method like AddRange that expects an array with any Python object that supports the Python sequence protocol, provided the items of the sequence are convertible to the item type of the managed array.

    • Added new demo scripts, mostly more substantial winforms examples.

    • โœ… Finished the unit tests for event support, and fixed lots of problems with events and delegates as a result. This is one of the trickier parts of the integration layer, and there is good coverage of these in the unit tests now.

    • Did a fair amount of profiling with an eval version of ANTS (which is quite nice, BTW) and made a few changes as a result.

    • ๐Ÿ”จ Type management was refactored, fixing the issue that caused segfaults when GC was enabled. Unit tests, stress tests and demo apps now all run nicely with Python GC enabled. There are one or two things left to fix, but the fixes should not have any user impact.

    • Changed to base PythonNet on Python 2.3.2. This is considered the most stable release, and a good 25 - 30% faster as well.

    • Added a new CLR.dll that acts as an extension module that allows an existing unmodified Python 2.3 installation to simply import CLR to bootstrap the managed integration layer.

    • A bug was causing managed methods to only expose overloads declared in a particular class, hiding inherited overloads of the same name. Fixed the bug and added some unit tests.

    • Added a virtual __doc__ attribute to managed methods that contains the signature of the method. This also means that the Python help function now provides signature info when used on a managed class.

    • Calling managed methods and events unbound (passing the instance as the first argument) now works. There is a caveat for methods - if a class declares both static and instance methods with the same name, it is not possible to call that instance method unbound (the static method will always be called).

    • ๐Ÿ‘ Overload selection for overloaded methods is now much better and uses a method resolution algorithm similar to that used by Jython.

    • Changed the managed python.exe wrapper to run as an STA thread, which seems to be more compatible with winforms apps. This needs a better solution long-term. One possibility would be a command line switch so that -sta or -mta could control the python.exe apartment state.

    • ๐Ÿ‘ Added support for the Python boolean type (True, False). Bool values now appear as True or False to Python.