← Back to issue list

refactor: Replace Python 3.10 workaround for enum value checking

View original Github issue

Metadata

Project
craft-platforms
Number
#233
Type
issue
State
open
Author
lengau
Labels
Created
Updated
Closed

Current evaluation

Refactor craft-platforms to replace a Python 3.10 try/except workaround for enum checking with a direct generator expression.

Suggested action: needs triage

Reason: The issue is a clear, actionable refactoring request authored by a maintainer, but it currently lacks labels, assignees, or maintainer comments indicating it has been triaged or prioritized.

Impact: 10 Quick Win: 9.0 Staleness: 65 Complexity: 10 Confidence: 80 Support Request: 0

Issue body

In `craft_platforms/_platforms.py`, the codebase uses `try...except ValueError` to check if `platform_name` is a valid Debian Architecture, with the comment: ```python # This is a workaround for Python 3.10. # In python 3.12+ we can just check: # `if platform_name not in _architectures.DebianArchitecture` ``` Even in older Python versions (like Python 3.8+), we can query the enum values directly without control flow using `try...except`: ```python if platform_name not in (arch.value for arch in _architectures.DebianArchitecture): raise _errors.InvalidDebianArchPlatformNameError(platform_name) ``` We should simplify this to make the intent clearer.

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 10
Quick Win: 9.0
Staleness: 65
Complexity: 10
Confidence: 80
Support Request: 0
needs triage Refactor craft-platforms to replace a Python 3.10 try/except workaround for enum checking with a direct generator expression.
qwen/qwen3.6-35b-a3b
Staleness: 40
Complexity: 10
Confidence: 90
Support Request: 0
keep open Refactoring task to replace a Python 3.10 enum workaround with a cleaner check. No comments, 36 days old.
qwen3.6-35b-a3b-mtp-q6
Staleness: 25
Complexity: 10
Confidence: 85
Support Request: 0
needs triage Refactor to replace a Python 3.10 workaround for checking enum values with a clearer generator expression. Currently unlabelled and awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 10
Complexity: 5
Confidence: 90
Support Request: 0
needs triage Refactor request to replace a Python 3.10 try/except workaround for enum validation with a clearer generator expression in craft_platforms/_platforms.py. Untriaged, no maintainer comments yet.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.