Skip to content

TypeError when calling a method with an enum argument #935

@vladt3

Description

@vladt3

Environment

  • Pythonnet version: 2.4.0
  • Python version: 3.6
  • Operating System: Windows10

Details

  • calling a method that uses C# enum as an argument with the enum fails with TypeError: No method matches given arguments for XXX

The enum comes in Python as an int, and since the method signature is not int, it fails.

I cannot see how to force the typecast, or whether I could somehow force the method call directly (overloads lists the method, but I can't figure out whether I can call directly).

Searching google did not return anything recent, although some older comments (2017/18 IIRC) indicated there was a fix for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions