Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers.
MethodBinder changes to allow implicit conversion. This one was particularly tricky and seemed impossible to patch together with the MethodBinder.cs in the root. Unfortunately it involved tearing apart a lot of it and rebuilding only what was needed. It may be possible to refactor this to look more like the root and still pass our tests. ( 58d5df0 , 44e089a , 108eacf , 6379568 , 9f2796a )
Revert PythonNet PR #1240 ; this PR broke fetching interface derived classes data members that weren't defined in the interface. ( ed6ab18 )
Converting PyObject to Int fix; this reflects the way PythonNet used to convert values to Int32, 64, unsigned etc, with PyNumber_Long but still keeps the use of Runtime.PyLong_AsSignedSize_t to finish the conversion. The bug that discovered this was trying to convert a Python float to int, this used to work but was failing until this refactor. Reference the added test in bd94e49. ( d87584b )
Tests added:
TimeDelta and DateTime Conversion Tests ( 508db2e )
List Conversion tests ( 5839d21 )
Dictionary Tests ( 101624e )
MethodBinder Tests ( bf1755d )
OperatorInequality Test ( b0aca5c )
PrimitiveIntConversion Test ( bd94e49 )
Interface Classes Test ( cd06d10 )
Some tests had to be adjusted for behavior changes caused by our commits. I have adjusted enough to have all PythonNet embedded tests passing, but there are still some issues with PyTests that need to be addressed/resolved.
What does this implement/fix? Explain your changes.
Get QC PythonNet up to date with root repo.
Related to https://github.com/QuantConnect/Lean/issues/452
To do this I needed to reflect a lot of our custom changes onto the root repo in order to keep QuantConnect functionality as desired.
QuantConnect Changes Reflected onto Root repo:
Patches to address failures in Lean:
PyNumber_Long
but still keeps the use ofRuntime.PyLong_AsSignedSize_t
to finish the conversion. The bug that discovered this was trying to convert a Python float to int, this used to work but was failing until this refactor. Reference the added test in bd94e49. ( d87584b )Tests added:
Some tests had to be adjusted for behavior changes caused by our commits. I have adjusted enough to have all PythonNet embedded tests passing, but there are still some issues with PyTests that need to be addressed/resolved.