Lightning-AI/pytorch-lightning

Adopt `typing_extensions.Override`

Open

#18,695 opened on Oct 3, 2023

View on GitHub
 (25 comments) (0 reactions) (1 assignee)Python (3,233 forks)batch import
featuregood first issuehelp wanted

Repository metrics

Stars
 (26,687 stars)
PR merge metrics
 (Avg merge 9d 15h) (3 merged PRs in 30d)

Description

Description & Motivation

We use overrides heavily.

Python 3.12 added support for this. See https://peps.python.org/pep-0698/

Mypy should support it: https://github.com/python/mypy/issues/14072

Pitch

Use https://typing-extensions.readthedocs.io/en/latest/#override in our overrides classes.

Using this would require increasing the minimum typing_extensions to 4.4: https://github.com/Lightning-AI/lightning/blob/master/requirements/fabric/base.txt#L8

Alternatives

No response

Additional context

No response

cc @borda

Contributor guide