Reworked Enum marshaling by lostmsu · Pull Request #1392 · pythonnet/pythonnet
lostmsu
marked this pull request as ready for review
- enums are no longer converted to and from PyLong automatically pythonnet#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
lostmsu
deleted the
PR/Disable-Enum-Implicit-Conv-To-Int
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters