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

Proposal: Implement binding manager to hold binding overrides#2543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
koubaa wants to merge1 commit intopythonnet:master
base:master
Choose a base branch
Loading
fromkoubaa:add-binding-options-upstream

Conversation

koubaa
Copy link
Contributor

@koubaakoubaa commentedJan 13, 2025
edited
Loading

What does this implement/fix? Explain your changes.

This adds a place to register at runtime options to customize the binding of types. This customization can be specified at a type or assembly level.

Does this close any currently open issues?

No, but it can be used as a way to close issues going forwards - especially in cases where there is disagreement about what the correct way to bind to python, or if there are legacy compatibility reasons to bind in a way that is not the default way. For example, in theansys-pythonnet fork, this is proposed to be used in two ways:

  1. to bind properties and methods coming fromexplicit interface implementation in order to satisfy a requirement in one library for compatibility with legacy IronPython scripts. In IronPython, explicit interface implementations are provided in Python, even when that is not the idiomatic choice.
  2. to automatically addpep8 aliases, allowing python code to use normal python style even when the C# library uses the normal C# style.

As this is just a proposal - I will move forward with the checklist if the maintainers of pythonnet agree with the direction.

Example usage (from python)

m = clr.AddReference('MyLib')from Python.Runtime import BindingManager, BindingOptionsbinding_options = BindingOptions()binding_options.SuppressDocs = TrueBindingManager.SetBindingOptions(m, binding_options)

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 toAUTHORS
  • Updated theCHANGELOG

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@koubaa

[8]ページ先頭

©2009-2025 Movatter.jp