Allow conversion of number to enum type when underlying type is assignable by slide · Pull Request #1179 · pythonnet/pythonnet

Skip to content

Navigation Menu

Sign in

Appearance settings

Conversation

In .NET you can do the following:
```
enum FooEnum {
	One = 1,
	Three = 3,
	Four = 4,
}

FooEnum x = (FooEnum)2;
```

This patch allows this from Python code as well.

@slide slide deleted the enum_conversion branch

July 6, 2020 20:05