Skip to content

Prefer using literal types over enums #576

Closed

Description

@vdusek
  • We should prefer typing.Literal types over enum.Enum.

Motivation

  • Better developer experience - Literals can be passed directly as values, without requiring additional imports.
  • Type safety is preserved - When used with a type checker, Literal types provide the same level of safety as enums.
  • Fewer footguns - The usage of enums can easily lead to bugs like this one: fix: Fix force permissions serialization for Actor calls #575.
  • Consistency across our tooling - We already prefer literals in Crawlee and the SDK.

Scope

Compatibility

  • This is a breaking change, so it should be tracked and implemented as part of apify-python-client v3.

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    debtCode quality improvement or decrease of technical debt.
    on Jan 9, 2026
  2. added this to the 3.0 milestone on Jan 9, 2026
  3. added 2 commits that reference this issue on Apr 27, 2026
    66da403
    2bf5a75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

debtCode quality improvement or decrease of technical debt.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions