-
Notifications
You must be signed in to change notification settings - Fork 748
overloading - more fixes for wordpad.py #170
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
Conversation
if (clrtype != null) { | ||
if (pi[n].ParameterType != clrtype) { | ||
IntPtr pytype = Converter.GetPythonTypeByAlias(pi[n].ParameterType); | ||
// does pytype require Decref? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a question? it's your code, you should understand it. Comments should help the people that come after you to understand the code, not raise questions about its correctness.
See contributing.md about grouping commits into logical units (which you've been told about numerous times already). I think this change warrants a new unit test to demonstrate the exact problem. In the meantime, if a user is having a problem a simply workaround is to construct the exact C# type an call the method with that (not that I'm against having this fixed in the main code). |
@denfromufa: With the modified version I am able to run the wordpad.py example. However, the commercial API still crashes when calling the method ReadNextResult with the following arguments:
with
However, it works with the methodbinder.cs version prior to patch #151 |
@mahibra I found out the problem last night while writing tests for improved overloading resolution in pythonnet, but have not finished my improved patch yet. Note that before it was working by accident, i.e. no type checking was done which could give you wrong results like this: The problem stems from Python 2 to 3 change of |
The following command works:
I have to convert both the Int and the Double values. Otherwise I get the error |
closing this in favor of #175 |
System.Drawing.Font("Tahoma", 10.0) supposed to use Single, which does not directly map to Python. Hence I added comparison in both directions for Double/Single, Int32/Int16.
This fixes issue observed by @mahibra that I reproduced today:
#103 (comment)