Skip to content

Conversation

@aparajit-pratap
Copy link

@aparajit-pratap aparajit-pratap commented Jan 9, 2026

What does this implement/fix? Explain your changes.

Background: When a .NET method returns a concrete type that implements an interface, e.g. IDisposable, pythonnet incorrectly resolves the object as the interface type instead of the concrete type. This prevents access to the concrete type's members and breaks common patterns using Python's with statement for resource management with IDisposable types.

This PR attempts to fix the above issue.

Does this close any currently open issues?

...

Any other comments?

Reviewers:
@zeusongit
@twastvedt
@zavub

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Ensure you have signed the .NET Foundation CLA
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@twastvedt
Copy link

Is it feasible to add a test for this?

@aparajit-pratap
Copy link
Author

Is it feasible to add a test for this?

I know how to add a test for this in Dynamo. Will explore how I can add a test to this project.

Copy link

@RobertGlobant20 RobertGlobant20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@twastvedt twastvedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like test CI needs some attention, but if this runs locally, looks good to me.

@aparajit-pratap
Copy link
Author

aparajit-pratap commented Jan 13, 2026

@twastvedt, my latest commit doesn't seem to have triggered the github workflows again. Any idea how I can manually trigger them?

@aparajit-pratap
Copy link
Author

Closing in favor of #6

@aparajit-pratap aparajit-pratap deleted the dyn-10011 branch January 15, 2026 20:57
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

Successfully merging this pull request may close these issues.

3 participants