Skip to content

Python: Add string alternatives at stable enum input boundaries #9635

Open

Description

Maintainer-owned issue. Community contributors: please do not pick up or start implementing this issue.

Problem

Some public APIs require callers to import enums for stable input vocabularies where a Literal[...] | EnumType input could keep the common path simpler. This should be applied selectively and must not change enum-valued outputs or internal state-machine semantics.

Use Case and Evidence

Core already provides a positive normalization pattern in feature-stage handling. Candidate input boundaries include evaluation and workflow configuration enums, but each requires verification that the vocabulary is stable and naturally represented as strings.

Desired Outcome

Audit exported enum-only input parameters, add typed string alternatives where practical, normalize at the boundary, and preserve existing enum acceptance, return types, serialization, and exhaustive internal dispatch.

Alternatives Considered

Converting enums to free-form strings would weaken typing and validation. Applying the pattern to internal state enums would add no user-facing benefit.

Proposed Direction

Add only closed Literal vocabularies, test equivalent enum/string behavior, and document the import-light path. Treat stricter validation or output changes as separate compatibility work.

Scope and Non-Goals

This issue is additive. It does not remove enums or change serialized/returned values.

Language

Python

Contribution Intent

Maintainer-owned; implementation must wait for maintainer design agreement.

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.

Ownership: Core maintainers only; not available for community pickup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonUsage: [Issues, PRs], Target: Python

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions