Your code is correct. It’s a CPython3/Pythonnet 2.5.x issue, .NET enums are automatically converted to Python int