- Notifications
You must be signed in to change notification settings - Fork749
Closed
Milestone
Description
Environment
- Pythonnet version: latest
- Python version: 3.9.4
- Operating System: Windows
- .NET Runtime:
Details
- Describe what you were trying to get done.
I would like to have the ability to extract the value of a .NetEnum
via python. One can do that usingMyEnum.value__
, however it seems logical that you should do it usingint(MyEnum)
.
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
importclrclr.AddReference("System.Windows.Forms")importSystem.Windows.FormsasWinFormsenum_value=WinForms.Keys.Controlprint(f"{enum_value=}")print(f"{enum_value.value__=}")
That prints:
enum_value=<System.Windows.Forms.Keys object at 0x000001C053E07580>enum_value.value__=131072
- If there was a crash, please include the traceback here.
No crash.
Metadata
Metadata
Assignees
Labels
No labels