pythonnet / pythonnet/pythonnet

implement a C# Interface in Python for .NET

Open
#674 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
C#
Stars
5.5k
Forks
780
PR merge metrics
No merged PRs in 30d

Description

Environment
  • Pythonnet version: 2.3.0
  • Python version: 3.6.5
  • Operating System: Windows
Details

trying to implement a C# Interface in Python for .NET

This post exemplifies my exact problem.
https://stackoverflow.com/questions/49736531/implement-a-c-sharp-interface-in-python-for-net#

However, I found relatively few discussion and solution. Forgive me raise the issue here. :)
I am not sure if this is an intent for pythonnet not to support. If so, reasons are welcomed.
Otherwise, I find the practice (implementing an interface) is common, and so why there is no support.
My use case is, I am given a dll. The interface is defined there. I want to develop Python class that implements the interface. Without this approach viable, I foresee my developed application would then be half in C# and half in Python, which I consider ugly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported case with pythonnet 2.3.0, Python 3.6.5, Windows, and a DLL containing a C# interface. Read the linked Stack Overflow example and inspect the existing Python-to-.NET interop behavior to define the supported implementation path and its expected tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.