Skip to content

fix: use Python 3.8-compatible annotations in errors.py#566

Merged
realfishsam merged 1 commit into
mainfrom
fix/561-errors-py-syntax
May 24, 2026
Merged

fix: use Python 3.8-compatible annotations in errors.py#566
realfishsam merged 1 commit into
mainfrom
fix/561-errors-py-syntax

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Fixes #561

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: VERIFIED

What This Does

Adds from __future__ import annotations to errors.py, making PEP 604 union syntax (str | None) and PEP 585 generics (dict[str, type[...]]) evaluate lazily at runtime, restoring Python 3.8 compatibility.

Blast Radius

  • Python SDK only (sdks/python/pmxt/errors.py)
  • No core/TS SDK/OpenAPI impact

Findings

  1. The from __future__ import annotations import correctly defers evaluation of all annotations in the file, fixing str | None on lines 12, 66, 84 and dict[str, type[PmxtError]] on line 102 -- all four 3.10+ constructs are covered by this single import.
  2. Consistent with existing usage in constants.py which already uses the same import.
  3. No functional behavior change -- purely a compatibility fix.

PMXT Pipeline Check

  • Field propagation: N/A
  • OpenAPI sync: N/A
  • Type safety: OK -- annotations still enforce correct types, just evaluated lazily

Semver Impact

patch -- fixes a SyntaxError on Python 3.8/3.9, no API change

Risk

None substantive. The from __future__ import annotations import is well-understood and has no side effects beyond deferred annotation evaluation.

@realfishsam realfishsam merged commit cfee14d into main May 24, 2026
10 of 11 checks passed
@realfishsam realfishsam deleted the fix/561-errors-py-syntax branch May 24, 2026 17:04
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.

[python-types] errors.py: Python 3.10+/3.9+ annotation syntax breaks Python 3.8 import

1 participant