Skip to content

int Enum can't be used with callback factory #885

Closed
@JrooTJunior

Description

@JrooTJunior

Context

Non-string enums can't be used with callback data factory

For example:

class MyEnum(Enum):
    foo = auto()
    bar = auto()


class MyCallback(CallbackData, prefix="my"):
    enum: MyEnum

Expected Behavior

MyCallback.unpack("my:1") -> MyCallback(enum=MyEnum.foo)

Current Behavior

Validation error

Metadata

Metadata

Assignees

Labels

3.xIssue or PR for stable 3.x versionbugSomething is wrong with the framework

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions