Lightning-AI/pytorch-lightning

Adopt `typing_extensions.Override`

Open

#18 695 ouverte le 3 oct. 2023

Voir sur GitHub
 (25 commentaires) (0 réactions) (1 assigné)Python (3 233 forks)batch import
featuregood first issuehelp wanted

Métriques du dépôt

Stars
 (26 687 stars)
Métriques de merge PR
 (Merge moyen 9j 15h) (3 PRs mergées en 30 j)

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

Guide contributeur