Skip to content

Conversation

@aparajit-pratap
Copy link

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

What does this implement/fix? Explain your changes.

Background: When a .NET method returns a concrete type that implements an IDisposable, e.g., in a with statement, 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?

...

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

@aparajit-pratap aparajit-pratap changed the title DYN-10011: Attempt #2 DYN-10011: Return runtime concrete type for types implementing .NET interfaces Attempt #2 Jan 14, 2026
@aparajit-pratap aparajit-pratap changed the title DYN-10011: Return runtime concrete type for types implementing .NET interfaces Attempt #2 DYN-10011: Return runtime concrete type for types implementing .NET IDisposable - Attempt #2 Jan 15, 2026
@twastvedt twastvedt merged commit 8a17b33 into autodesk-forks:dynamo_py3 Jan 15, 2026
18 of 24 checks passed
@aparajit-pratap aparajit-pratap deleted the dyn-10011_2 branch January 15, 2026 20:26
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.

2 participants