-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
debtCode quality improvement or decrease of technical debt.Code quality improvement or decrease of technical debt.t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Milestone
Description
- We should prefer
typing.Literaltypes overenum.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
- This primarily applies to constants currently defined as enums, especially those in: https://github.com/apify/apify-shared-python/blob/master/src/apify_shared/consts.py.
Compatibility
- This is a breaking change, so it should be tracked and implemented as part of apify-python-client v3.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
debtCode quality improvement or decrease of technical debt.Code quality improvement or decrease of technical debt.t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Type
Fields
Give feedbackNo fields configured for issues without a type.