New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
match python type T to Nullable<T> in C# #1191
base: master
Are you sure you want to change the base?
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.
|


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