match python type T to Nullable<T> in C##1191
match python type T to Nullable<T> in C##1191hatami57 wants to merge 2 commits intopythonnet:masterfrom
Conversation
When a method parameter in C# is defined as Nullable like `int?` and you call it in python by a literal int number, it does not match with `int?` and could not bind the method. At least in .NETStandard2.0. So this update is telling the MethodBinder class that a primitive value (with the type of T) in python can be matched with the corresponding primitive type (T) in C# or Nullable<T> too.
Codecov Report
@@ Coverage Diff @@
## master #1191 +/- ##
=======================================
Coverage 86.25% 86.25%
=======================================
Files 1 1
Lines 291 291
=======================================
Hits 251 251
Misses 40 40
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
|
Honestly, I am not even sure we need |
|
Anyway I couldn't call a C# class constructor say For now, I think |
|
@hatami57 can you try passing a |
As far as I remember, I did try it but it didn't work... |
Codecov Report
@@ Coverage Diff @@
## master #1191 +/- ##
===========================================
+ Coverage 74.04% 86.25% +12.20%
===========================================
Files 1 1
Lines 289 291 +2
===========================================
+ Hits 214 251 +37
+ Misses 75 40 -35
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
@hatami57 Did you try what lostmsu suggested again on 3.0? |
When a method parameter in C# is defined as
Nullablelikeint?and you call it in python by like a literal int number, it does not match withint?and could not bind the method, at least in .NETStandard2.0. So this update is telling theMethodBinderclass that a primitive value (with the type ofT) in python can be matched with the corresponding primitive type (T) in C# or theNullable<T>type too.What does this implement/fix? Explain your changes.
...
Does this close any currently open issues?
...
Any other comments?
...
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOG