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

Reworked Enum marshaling#1392

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

Conversation

lostmsu
Copy link
Member

@lostmsulostmsu commentedFeb 20, 2021
edited
Loading

What does this implement/fix? Explain your changes.

  • enums are no longer converted to and fromPyLong automatically.NET enums should not be automatically converted to Python int and back #1220
  • one can construct an instance ofMyEnum from Python usingMyEnum(numeric_val), e.g.MyEnum(10)
  • in the above, ifMyEnum does not have[Flags] and does not have member with value10 defined, to createMyEnum with value10 one must callMyEnum(10, True). HereTrue is an unnamed parameter, that allows unchecked conversion
  • legacy behavior has been moved to a codec:EnumPyLongCodec; enums can now be encoded by codecs
  • addedEnumOps class, that implements bitwise operations on[Flags] enums.

Does this close any currently open issues?

#1220

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • Updated theCHANGELOG

@lostmsulostmsuforce-pushed thePR/Disable-Enum-Implicit-Conv-To-Int branch fromc00ae2b to429cc3bCompareFebruary 20, 2021 22:42
@lostmsulostmsu marked this pull request as draftFebruary 20, 2021 22:47
@lostmsulostmsuforce-pushed thePR/Disable-Enum-Implicit-Conv-To-Int branch from429cc3b to9bff356CompareFebruary 21, 2021 00:59
@lostmsulostmsu marked this pull request as ready for reviewFebruary 21, 2021 01:04
@lostmsulostmsuforce-pushed thePR/Disable-Enum-Implicit-Conv-To-Int branch 2 times, most recently from48655d8 tof77b131CompareFebruary 21, 2021 06:15
- enums are no longer converted to and from PyLong automaticallypythonnet#1220- one can construct an instance of MyEnum from Python using MyEnum(numeric_val), e.g. MyEnum(10)- in the above, if MyEnum does not have [Flags] and does not have value 10 defined, to create MyEnum with value 10 one must call MyEnum(10, True). Here True is an unnamed parameter, that allows unchecked conversion- legacy behavior has been moved to a codec (EnumPyLongCodec); enums can now be encoded by codecs- flags enums support bitwise ops via EnumOps class
@lostmsulostmsuforce-pushed thePR/Disable-Enum-Implicit-Conv-To-Int branch fromf77b131 to5c41499CompareMarch 30, 2021 23:44
@lostmsulostmsu merged commit6379221 intopythonnet:masterMar 30, 2021
@lostmsulostmsu deleted the PR/Disable-Enum-Implicit-Conv-To-Int branchMarch 30, 2021 23:49
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
@lostmsu

[8]ページ先頭

©2009-2025 Movatter.jp