- Notifications
You must be signed in to change notification settings - Fork768
[Out] parameters no longer added to return tuple#1308
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ed in addition to the regular method return value (unless they are passed with `ref` or `out` keyword).
filmor commentedDec 8, 2020
I think this was included for compatibility with IronPython. How would you handle out parameters that still have automatic conversions like |
codecov-io commentedDec 8, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #1308 +/- ##===========================================- Coverage 87.88% 74.04% -13.85%=========================================== Files 1 1 Lines 289 289 ===========================================- Hits 254 214 -40- Misses 35 75 +40
Flags with carried forward coverage won't be shown.Click here to find out more.
Continue to review full report at Codecov.
|
lostmsu commentedDec 8, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@filmor this is the confusing part. This change does not affect This annotation is normally meant for P/Invoke marshaling scenarios, where you have to add |
lostmsu commentedDec 8, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
For an instance of API difference between implementations in regards to In .NET Core In Mono it is present for COM-compatibility:https://github.com/mono/mono/blob/c5b88ec4f323f2bdb7c7d0a595ece28dae66579c/mcs/class/referencesource/mscorlib/system/io/memorystream.cs#L339 Without this change the same Python code would not work with both Mono and .NET Core. |
filmor commentedDec 8, 2020
Thanks for the explanation. I ran into this problem while testing .NET Core and couldn't really make sense of it, wasn't aware of |
Uh oh!
There was an error while loading.Please reload this page.
Parameters marked with
ParameterAttributes.Out(aka[Out]) are no longer returned in addition to the regular method return value (unless they are passed withreforoutkeyword).What does this implement/fix? Explain your changes.
As it is now possible to pass raw .NET objects to .NET methods, there's no need to marshal
[Out]parameters back to Python manually. Python users can simply access modified object's data directly.Any other comments?
It was confusing to see
read, _ = stream.Read(buff, 0, buff.Length)in the test code, asReadmethod does not really have anyoutorrefparameters. It also failed on some .NET implementations, as the corresponding parameter does not always have an[Out]attribute.Related issues
This should unblock#1307 (tests there are failing because of this difference).
Checklist
Check all those that are applicable and complete.
AUTHORSCHANGELOG