Skip to content

Same name functions , the pythonnet donl't found right function. #782

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

Closed
jiftle opened this issue Nov 19, 2018 · 6 comments
Closed

Same name functions , the pythonnet donl't found right function. #782

jiftle opened this issue Nov 19, 2018 · 6 comments
Assignees

Comments

@jiftle
Copy link

jiftle commented Nov 19, 2018

Environment

  • Pythonnet version: 2.3
  • Python version: Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]
  • Operating System: win7 x64

Details

  • Same name functions , the pythonnet donl't found right function.
    error info
Traceback (most recent call last):
  File "testdll.py", line 111, in <module>
    ret = _Interpreter.csc(1, filename, paramlist, errMsg)
TypeError: No method matches given arguments

mycode

public int csc(int type, string filename, strtParam[] paramArray, ref string strErr)
public int csc(string filename, strtParam[] paramArray, ref string strErr)
  • Modify code ,use different function name just successed.
    midify code
public int cscPT(int type, string filename, strtParam[] paramArray, ref string strErr)
        {
            return csc(type, filename, paramArray, ref strErr);
        }
@filmor
Copy link
Member

filmor commented Nov 19, 2018

So, the modified code works?

@jiftle
Copy link
Author

jiftle commented Nov 19, 2018

@filmor
yes , it work good.

@filmor
Copy link
Member

filmor commented Nov 19, 2018

That's strange, I'll try to reproduce it.

@jiftle
Copy link
Author

jiftle commented Nov 19, 2018

@filmor
thank you very much, you are good author.

@filmor filmor self-assigned this Nov 19, 2018
@den-run-ai
Copy link
Contributor

This is from the method overloading pile, let me know if this is not covered by existing items:

#265

@lostmsu
Copy link
Member

lostmsu commented Jan 24, 2019

Just got this error. Can anyone explain why this happens when one of my overloads has matching number of arguments, and they are all of type object? E.g. surely this one can be called. Or does this error happen also when there's an ambiguity? In the later case, can the error be fixed to indicate that?

lostmsu added a commit to losttech/pythonnet that referenced this issue Feb 11, 2019
lostmsu added a commit to losttech/pythonnet that referenced this issue Jun 26, 2019
filmor pushed a commit that referenced this issue Jun 28, 2019
…#900)

* generate more useful message, when a .NET overload can't be found, that matches Python parameter types
* provide detailed error message, when an overload can't be found when calling C# from Python

Related: #811, #265, #782
@jiftle jiftle closed this as completed Sep 3, 2019
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this issue Jun 18, 2020
…pythonnet#900)

* generate more useful message, when a .NET overload can't be found, that matches Python parameter types
* provide detailed error message, when an overload can't be found when calling C# from Python

Related: pythonnet#811, pythonnet#265, pythonnet#782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants