Fix Python 3.8 compatibility of a TypeAlias.

Review Request #14008 — Created July 2, 2024 and submitted

Information

Review Board
release-7.x

Reviewers

We had one place where we were defining a TypeAlias using the
newer-style list[...] (and related), which doesn't work for Python
3.8. This works fine for type annotations on all versions, but for type
aliases, it's a runtime error. Luckily this was hidden behind a check
for TYPE_CHECKING so it didn't break production.

This change also moves a couple more things into the TYPE_CHECKING
block.

Ran unit tests.

Summary ID
Fix Python 3.8 compatibility of a TypeAlias.
We had one place where we were defining a `TypeAlias` using the newer-style `list[...]` (and related), which doesn't work for Python 3.8. This works fine for type annotations on all versions, but for type aliases, it's a runtime error. Luckily this was hidden behind a check for `TYPE_CHECKING` so it didn't break production. This change also moves a couple more things into the `TYPE_CHECKING` block. Testing Done: Ran unit tests.
0370247e03f84e75e87de8e46414a261b4cf3d9a
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.x (b09fac3)