Skip to content

Commit 6092dc7

Browse files
authored
TYP: use typing.final in indexes.base (#37527)
1 parent 56a9e75 commit 6092dc7

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

pandas/_typing.py

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
# and use a string literal forward reference to it in subsequent types
2828
# https://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles
2929
if TYPE_CHECKING:
30+
from typing import final
31+
3032
from pandas._libs import Period, Timedelta, Timestamp
3133

3234
from pandas.core.dtypes.dtypes import ExtensionDtype
@@ -42,6 +44,10 @@
4244
from pandas.core.window.rolling import BaseWindow
4345

4446
from pandas.io.formats.format import EngFormatter
47+
else:
48+
# typing.final does not exist until py38
49+
final = lambda x: x
50+
4551

4652
# array-like
4753

0 commit comments

Comments
 (0)