File tree Expand file tree Collapse file tree 14 files changed +33
-35
lines changed
Expand file tree Collapse file tree 14 files changed +33
-35
lines changed Original file line number Diff line number Diff line change 11from typing import (
22 Iterator ,
33 Sequence ,
4+ final ,
45 overload ,
56)
67
@@ -50,10 +51,12 @@ class SharedBlock:
5051
5152class NumpyBlock (SharedBlock ):
5253 values : np .ndarray
54+ @final
5355 def getitem_block_index (self : T , slicer : slice ) -> T : ...
5456
5557class NDArrayBackedBlock (SharedBlock ):
5658 values : NDArrayBackedExtensionArray
59+ @final
5760 def getitem_block_index (self : T , slicer : slice ) -> T : ...
5861
5962class Block (SharedBlock ): ...
Original file line number Diff line number Diff line change @@ -517,7 +517,6 @@ cdef class NumpyBlock(SharedBlock):
517517 # set placement and ndim
518518 self .values = values
519519
520- # @final # not useful in cython, but we _would_ annotate with @final
521520 cpdef NumpyBlock getitem_block_index(self , slice slicer):
522521 """
523522 Perform __getitem__-like specialized to slicing along index.
@@ -540,7 +539,6 @@ cdef class NDArrayBackedBlock(SharedBlock):
540539 # set placement and ndim
541540 self .values = values
542541
543- # @final # not useful in cython, but we _would_ annotate with @final
544542 cpdef NDArrayBackedBlock getitem_block_index(self , slice slicer):
545543 """
546544 Perform __getitem__-like specialized to slicing along index.
Original file line number Diff line number Diff line change 3737# and use a string literal forward reference to it in subsequent types
3838# https://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles
3939if TYPE_CHECKING :
40- from typing import (
41- TypedDict ,
42- final ,
43- )
40+ from typing import TypedDict
4441
4542 import numpy .typing as npt
4643
7673 from pandas .tseries .offsets import DateOffset
7774else :
7875 npt : Any = None
79- # typing.final does not exist until py38
80- final = lambda x : x
8176 # typing.TypedDict does not exist until py38
8277 TypedDict = dict
8378
Original file line number Diff line number Diff line change 1313 Literal ,
1414 TypeVar ,
1515 cast ,
16+ final ,
1617)
1718
1819import numpy as np
2425 FrameOrSeries ,
2526 IndexLabel ,
2627 Shape ,
27- final ,
2828 npt ,
2929)
3030from pandas .compat import PYPY
Original file line number Diff line number Diff line change 1818 Mapping ,
1919 Sequence ,
2020 cast ,
21+ final ,
2122 overload ,
2223)
2324import warnings
5455 TimedeltaConvertibleTypes ,
5556 TimestampConvertibleTypes ,
5657 ValueKeyFunc ,
57- final ,
5858 npt ,
5959)
6060from pandas .compat ._optional import import_optional_dependency
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class providing the base-class of operations.
2929 TypeVar ,
3030 Union ,
3131 cast ,
32+ final ,
3233)
3334import warnings
3435
@@ -49,7 +50,6 @@ class providing the base-class of operations.
4950 RandomState ,
5051 Scalar ,
5152 T ,
52- final ,
5353)
5454from pandas .compat .numpy import function as nv
5555from pandas .errors import AbstractMethodError
Original file line number Diff line number Diff line change 44"""
55from __future__ import annotations
66
7- from typing import Hashable
7+ from typing import (
8+ Hashable ,
9+ final ,
10+ )
811import warnings
912
1013import numpy as np
1114
1215from pandas ._typing import (
1316 ArrayLike ,
1417 FrameOrSeries ,
15- final ,
1618)
1719from pandas .errors import InvalidIndexError
1820from pandas .util ._decorators import cache_readonly
Original file line number Diff line number Diff line change 1414 Hashable ,
1515 Iterator ,
1616 Sequence ,
17+ final ,
1718 overload ,
1819)
1920
3132 F ,
3233 FrameOrSeries ,
3334 Shape ,
34- final ,
3535 npt ,
3636)
3737from pandas .errors import AbstractMethodError
Original file line number Diff line number Diff line change 1313 Sequence ,
1414 TypeVar ,
1515 cast ,
16+ final ,
1617 overload ,
1718)
1819import warnings
4445 F ,
4546 Shape ,
4647 T ,
47- final ,
4848 npt ,
4949)
5050from pandas .compat .numpy import function as nv
Original file line number Diff line number Diff line change 1111 Sequence ,
1212 TypeVar ,
1313 cast ,
14+ final ,
1415)
1516import warnings
1617
2829 Tick ,
2930 parsing ,
3031)
31- from pandas ._typing import final
3232from pandas .compat .numpy import function as nv
3333from pandas .util ._decorators import (
3434 Appender ,
You can’t perform that action at this time.
0 commit comments