Skip to content

Modernize type annotations: PEP 604 and collections.abc imports#4912

Closed
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D93275514
Closed

Modernize type annotations: PEP 604 and collections.abc imports#4912
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D93275514

Conversation

@saitcakmak
Copy link
Contributor

Summary:
Modernize type annotations across Ax (open-source and ax/fb):

  • Replace Optional[X] with X | None and Union[X, Y] with X | Y (PEP 604).
  • Move Callable, Sequence, Mapping, and Iterable imports from typing to collections.abc.
  • Remove unused typing imports where they become empty.

Pure annotation changes with no behavioral impact. Files that use Union at runtime (e.g., with assert_is_instance) are left unchanged.

Reviewed By: Balandat

Differential Revision: D93275514

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 17, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 17, 2026

@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93275514.

…book#4912)

Summary:
Pull Request resolved: facebook#4912

Modernize type annotations across Ax (open-source and ax/fb):
- Replace `Optional[X]` with `X | None` and `Union[X, Y]` with `X | Y` (PEP 604).
- Move `Callable`, `Sequence`, `Mapping`, and `Iterable` imports from `typing` to `collections.abc`.
- Remove unused `typing` imports where they become empty.

Pure annotation changes with no behavioral impact. Files that use `Union` at runtime (e.g., with `assert_is_instance`) are left unchanged.

Reviewed By: Balandat

Differential Revision: D93275514
@meta-codesync
Copy link

meta-codesync bot commented Feb 17, 2026

This pull request has been merged in 983c00c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments