FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ref/out parameters compatibility · Issue #228 · pythonnet/pythonnet · GitHub

Repository navigation

ref/out parameters compatibility #228

Closed

Description

https://sourceforge.net/p/pythonnet/patches/10/

The way out and ref parameters are handled is not compatible with IronPython. In IronPython, out parameters do not have to be provided, in pythonnet, you always have to pass something (but it is not really used). The resulting out parameters are returned as return values in both IronPython and pythonnet, but a void result is always omitted in IronPython whereas it is only omitted in pythonnet if there is only a single out parameter.
Example:
To call method "public static void TwoOut(int i, out string sOut, out int iOut)" you have to use "TwoOut(iIn, sOut, iOut)" in pythonnet with sOut a string and iOut an int, and you will receive a (void, string, int) tuple as the return value; in IronPython, you can call "TwoOut(iIn)" and you get a (string, int) tuple as the result.
The attached patch makes the IronPython behavior available in pythonnet while still keeping compatibility with the existing behavior.

Activity

  1. filmor commented on Jun 13, 2016

    Member

    Does that patch still apply cleanly?

  2. den-run-ai commented on Jun 13, 2016

    ContributorAuthor

    @filmor how do I check it quickly?

  3. den-run-ai commented on Jun 13, 2016

    ContributorAuthor

    I got "Patch format detection failed." with tortoisegit

  4. den-run-ai commented on Jun 27, 2018

    ContributorAuthor
  5. den-run-ai commented on Jun 27, 2018

    ContributorAuthor

    Well, at least this is clearly documented in the comments of code and partial IPY compatibility:

    // If there are out parameters, we return a tuple containing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL