Skip to content

Use X | None instead of Optional[X] (UP045) - #5570

Open
AniketBajaj2024 wants to merge 1 commit into
Osmantic:mainfrom
AniketBajaj2024:fix/up045-optional-to-pep604
Open

AniketBajaj2024 wants to merge 1 commit into
Osmantic:mainfrom
AniketBajaj2024:fix/up045-optional-to-pep604

Conversation

@AniketBajaj2024

Copy link
Copy Markdown
Contributor

PEP 604 union syntax, available since Python 3.10. The dashboard-api container runs python:3.11-slim, so these annotations evaluate fine at runtime even in modules without 'from future import annotations'.

Applied by 'ruff check --select UP045 --fix'. Every touched file was byte-compiled afterwards to confirm the annotations still parse.

PEP 604 union syntax, available since Python 3.10. The dashboard-api
container runs python:3.11-slim, so these annotations evaluate fine at
runtime even in modules without 'from __future__ import annotations'.

Applied by 'ruff check --select UP045 --fix'. Every touched file was
byte-compiled afterwards to confirm the annotations still parse.
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