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

Add C# Dictionary to Python Dict conversion#972

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

Closed
thesn10 wants to merge3 commits intopythonnet:masterfromthesn10:master

Conversation

thesn10
Copy link
Contributor

What does this implement/fix? Explain your changes.

You can now convert a C# IDictionary to a Python Dict by calling ToPython()

Dictionary<string, string> dict = new Dictionary<string, string>();dict.Add("hello", "world");dynamic d = dict.ToPython();string value = d.get("hello", "");

Does this close any currently open issues?

No, but it is progress for#623

Any other comments?

Do i really have to include a test for this? I mean, theTestConverter.cs file doesnt have any tests for other similar types likeIList at all.

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

@codecov-io
Copy link

codecov-io commentedOct 18, 2019
edited
Loading

Codecov Report

Merging#972 intomaster willnot change coverage.
The diff coverage isn/a.

Impacted file tree graph

@@           Coverage Diff           @@##           master     #972   +/-   ##=======================================  Coverage   86.71%   86.71%           =======================================  Files           1        1             Lines         301      301           =======================================  Hits          261      261             Misses         40       40
FlagCoverage Δ
#setup_linux65.44% <ø> (ø)⬆️
#setup_windows71.42% <ø> (ø)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update4a9457f...6b43096. Read thecomment docs.

@filmor
Copy link
Member

Thanks a lot for this. However, as noted in#963, I'd really like to get away from the implicit conversions and instead allow the wrapped C# object toact like a Pythondict without actually performing the conversion (unless explicitly requested).

@thesn10
Copy link
ContributorAuthor

Oh thats nice :) Will it take long until the implicit conversions get replaced? Because maybe this PR could still be a temporary solution to allow the use ofIDictionary as a pythondict.

In#963 you only mentionIEnumerable andICollection. Will there be a solution forIDictionary too?

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.

3 participants
@thesn10@codecov-io@filmor

[8]ページ先頭

©2009-2025 Movatter.jp