Skip to content

fix: improve compatibility for Python 3.9+ with type hint unions#1

Open
Elyter wants to merge 2 commits intocruzanstx:mainfrom
Elyter:fix-python-39-compat
Open

fix: improve compatibility for Python 3.9+ with type hint unions#1
Elyter wants to merge 2 commits intocruzanstx:mainfrom
Elyter:fix-python-39-compat

Conversation

@Elyter
Copy link
Copy Markdown

@Elyter Elyter commented Mar 31, 2026

Description

Although this project specifies Python 3.10+ as a requirement, many users (especially on macOS or older Linux distros) still have python3 defaulting to Python 3.9 out of the box. Running the CLI directly on these systems currently leads to an immediate crash:

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

This PR adds a tiny, zero-dependency one-liner (from __future__ import annotations) to defer the evaluation of type annotations. This simple addition makes the modern dict | None syntax seamlessly backward-compatible down to Python 3.7.

Motivation

This ensures a much smoother first-time experience for users running older Python versions, without needing any code refactoring constraints for the repository!

@Elyter Elyter changed the title Fix python 39 compat fix: improve compatibility for Python 3.7+ with type hint unions Mar 31, 2026
@Elyter Elyter changed the title fix: improve compatibility for Python 3.7+ with type hint unions fix: improve compatibility for Python 3.9+ with type hint unions Mar 31, 2026
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