QuantConnect / pythonnet

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.
http://pythonnet.github.io
MIT License
28 stars 27 forks source link

Fix Generic Matching with PyTypes in Args #60

Closed C-SELLERS closed 2 years ago

C-SELLERS commented 2 years ago

What does this implement/fix? Explain your changes.

Addresses an issue with the generic binding implementation that would cause PythonNet to crash when supplying a PyType in the args.

Instead of using the PythonArgsToTypeArray() which relies on the PyType being defined in RunTime we just used the already converted args from the method binder (margs), and extract their types in ResolveGenericMethod.

Also address a small issue with using py datetime.date objects in place of C# DateTime args.

...

Does this close any currently open issues?

N/A

...

Any other comments?

...

Checklist

Check all those that are applicable and complete.