Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

pythonnet 3.0 breaks access to methods whos signature returns an interface but clients want to use the concrete type #1914

Closed as not planned
@koubaa

Description

@koubaa

Environment

  • Pythonnet version: 3.0+
  • Python version: any
  • Operating System: any
  • .NET Runtime: any

tldr;
#1240 changes the behavior of pythonnet to wrap only the interface methods/members of objects returned by a .NET method whose method declaration states that it returns an interface. Prior to this change, the python object that pythonnet created for the return object wrapped the returned object instance, but did not necessarily implement the interface. The prior behavior was useful for idiomatic C# patterns like the factory pattern.

This wasdiscussed on the mailing list and I wanted to file an issue here.

Apparently, the change was also reverted in theQuantConnect fork.

My preferred fix, for what its worth, is option 4 (from the list of options mentioned by Victor in that thread):

IronPython apparently allows explicit interface implementations to be called (instead of returning interface-wrapped instances), if there’s no conflict with regular methods. Perhaps we should consider this as an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp