Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Enable C# objects to be callable #890

Copy link
Copy link
@lostmsu

Description

@lostmsu
Issue body actions

Environment

  • Pythonnet version: 2.4.0
  • Python version: ANY
  • Operating System: ANY

Details

Given C# class Callable

class Callable {
  public int __call__(int arg) => arg * 2;
}

Be able call an instance of it like a function in Python:

callable = Callable()
print(callable(21))

Expected: should print 42
Actual: TypeError : object is not callable

Note

I am actually working on this. This is a tracking issue to reference in commits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.