Lightning-AI/pytorch-lightning

Adopt `typing_extensions.Override`

開放

#18,695 建立於 2023年10月3日

 (25 則留言) (0 個反應) (1 位負責人)Python (3,233 個分叉)batch import
featuregood first issuehelp wanted

倉庫指標

星標
 (26,687 顆星)
PR 合併指標
 (平均合併 9天 15小時) (30 天內合併 3 個 PR)

描述

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

貢獻者指南