Skip to content

fix: use Python 3.8-compatible generics in models.py#567

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

fix: use Python 3.8-compatible generics in models.py#567
realfishsam merged 1 commit into
mainfrom
fix/562-models-py-syntax

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Fixes #562

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: VERIFIED

What This Does

Replaces three list[T] (PEP 585, Python 3.9+) annotations with List[T] (from typing) in the SubscribedAddressSnapshot dataclass in models.py, restoring Python 3.8 compatibility.

Blast Radius

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

Findings

  1. All three occurrences of lowercase list[T] in models.py are fixed (lines 483, 486, 489). Grep confirms no other instances remain.
  2. List is already imported from typing on line 9 of the file -- no new import needed.
  3. The rest of models.py already uses List[T] and Optional[...] consistently; these three were the only outliers.
  4. An alternative approach would have been from __future__ import annotations (as PR 566 does for errors.py), but the List[T] approach is also correct and matches the existing style in this file.

PMXT Pipeline Check

  • Field propagation: N/A
  • OpenAPI sync: N/A
  • Type safety: OK -- semantically identical annotations

Semver Impact

patch -- fixes TypeError on Python 3.8, no API change

Risk

None. typing.List[T] is equivalent to list[T] for all supported Python versions.

@realfishsam realfishsam merged commit 549e2c8 into main May 24, 2026
10 of 11 checks passed
@realfishsam realfishsam deleted the fix/562-models-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] models.py: bare list[T] syntax in SubscribedAddressSnapshot breaks Python 3.8

1 participant