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

Added a decoder to be able to handle Func<> parameters#2049

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
Romout wants to merge3 commits intopythonnet:master
base:master
Choose a base branch
Loading
fromRomout:feature-FuncDecoder

Conversation

Romout
Copy link

@RomoutRomout commentedDec 15, 2022
edited
Loading

What does this implement/fix? Explain your changes.

It's a decoder to ease use of C# Func<> method arguments. Previously, it was necessary to cast the python lambda expression to System.Func[...] which is very cumbersome for a script-user.

Does this close any currently open issues?

Was not my intention.

Any other comments?

The solution I used is quite complex as it needs to create wrapper types for each Func-Type-Variant. Code creation is implemented using the IL Code Generator, types are cached, generic type arguments are again converted using ToPython()

I hope my change is of some help!

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

koubaa and Romout reacted with hooray emoji
…mbdas or similar without the need of casting to System.Func
@koubaa
Copy link
Contributor

FWIW I attempted a function codec before - and it was mentioned in the PR that it should have used code generation to be more correct:pythonnet/codecs#1

@Romout
Copy link
Author

I don't know why the build for 3.7 on 32bit didn't succeed. Can someone help with that?

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.

2 participants
@Romout@koubaa

[8]ページ先頭

©2009-2025 Movatter.jp