Skip to content

Feature: Support enum members as scalar schemas and mapping keys#537

Open
epenet wants to merge 1 commit into
alecthomas:masterfrom
epenet:feature/enum-as-schema
Open

Feature: Support enum members as scalar schemas and mapping keys#537
epenet wants to merge 1 commit into
alecthomas:masterfrom
epenet:feature/enum-as-schema

Conversation

@epenet
Copy link
Copy Markdown
Contributor

@epenet epenet commented May 28, 2026

Allow an enum.Enum member to be used directly as a schema (matched by equality) and as a mapping key, by compiling it as a scalar.

Spotted in home-assistant/core#172425 and home-assistant/architecture#1406

Allow an enum.Enum member to be used directly as a schema (matched by
equality) and as a mapping key, by compiling it as a scalar.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant