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 1
1
from typing import (
2
2
Iterator ,
3
3
Sequence ,
4
+ final ,
4
5
overload ,
5
6
)
6
7
@@ -50,10 +51,12 @@ class SharedBlock:
50
51
51
52
class NumpyBlock (SharedBlock ):
52
53
values : np .ndarray
54
+ @final
53
55
def getitem_block_index (self : T , slicer : slice ) -> T : ...
54
56
55
57
class NDArrayBackedBlock (SharedBlock ):
56
58
values : NDArrayBackedExtensionArray
59
+ @final
57
60
def getitem_block_index (self : T , slicer : slice ) -> T : ...
58
61
59
62
class Block (SharedBlock ): ...
Original file line number Diff line number Diff line change @@ -517,7 +517,6 @@ cdef class NumpyBlock(SharedBlock):
517
517
# set placement and ndim
518
518
self .values = values
519
519
520
- # @final # not useful in cython, but we _would_ annotate with @final
521
520
cpdef NumpyBlock getitem_block_index(self , slice slicer):
522
521
"""
523
522
Perform __getitem__-like specialized to slicing along index.
@@ -540,7 +539,6 @@ cdef class NDArrayBackedBlock(SharedBlock):
540
539
# set placement and ndim
541
540
self .values = values
542
541
543
- # @final # not useful in cython, but we _would_ annotate with @final
544
542
cpdef NDArrayBackedBlock getitem_block_index(self , slice slicer):
545
543
"""
546
544
Perform __getitem__-like specialized to slicing along index.
Original file line number Diff line number Diff line change 37
37
# and use a string literal forward reference to it in subsequent types
38
38
# https://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles
39
39
if TYPE_CHECKING :
40
- from typing import (
41
- TypedDict ,
42
- final ,
43
- )
40
+ from typing import TypedDict
44
41
45
42
import numpy .typing as npt
46
43
76
73
from pandas .tseries .offsets import DateOffset
77
74
else :
78
75
npt : Any = None
79
- # typing.final does not exist until py38
80
- final = lambda x : x
81
76
# typing.TypedDict does not exist until py38
82
77
TypedDict = dict
83
78
Original file line number Diff line number Diff line change 13
13
Literal ,
14
14
TypeVar ,
15
15
cast ,
16
+ final ,
16
17
)
17
18
18
19
import numpy as np
24
25
FrameOrSeries ,
25
26
IndexLabel ,
26
27
Shape ,
27
- final ,
28
28
npt ,
29
29
)
30
30
from pandas .compat import PYPY
Original file line number Diff line number Diff line change 18
18
Mapping ,
19
19
Sequence ,
20
20
cast ,
21
+ final ,
21
22
overload ,
22
23
)
23
24
import warnings
54
55
TimedeltaConvertibleTypes ,
55
56
TimestampConvertibleTypes ,
56
57
ValueKeyFunc ,
57
- final ,
58
58
npt ,
59
59
)
60
60
from 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.
29
29
TypeVar ,
30
30
Union ,
31
31
cast ,
32
+ final ,
32
33
)
33
34
import warnings
34
35
@@ -49,7 +50,6 @@ class providing the base-class of operations.
49
50
RandomState ,
50
51
Scalar ,
51
52
T ,
52
- final ,
53
53
)
54
54
from pandas .compat .numpy import function as nv
55
55
from pandas .errors import AbstractMethodError
Original file line number Diff line number Diff line change 4
4
"""
5
5
from __future__ import annotations
6
6
7
- from typing import Hashable
7
+ from typing import (
8
+ Hashable ,
9
+ final ,
10
+ )
8
11
import warnings
9
12
10
13
import numpy as np
11
14
12
15
from pandas ._typing import (
13
16
ArrayLike ,
14
17
FrameOrSeries ,
15
- final ,
16
18
)
17
19
from pandas .errors import InvalidIndexError
18
20
from pandas .util ._decorators import cache_readonly
Original file line number Diff line number Diff line change 14
14
Hashable ,
15
15
Iterator ,
16
16
Sequence ,
17
+ final ,
17
18
overload ,
18
19
)
19
20
31
32
F ,
32
33
FrameOrSeries ,
33
34
Shape ,
34
- final ,
35
35
npt ,
36
36
)
37
37
from pandas .errors import AbstractMethodError
Original file line number Diff line number Diff line change 13
13
Sequence ,
14
14
TypeVar ,
15
15
cast ,
16
+ final ,
16
17
overload ,
17
18
)
18
19
import warnings
44
45
F ,
45
46
Shape ,
46
47
T ,
47
- final ,
48
48
npt ,
49
49
)
50
50
from pandas .compat .numpy import function as nv
Original file line number Diff line number Diff line change 11
11
Sequence ,
12
12
TypeVar ,
13
13
cast ,
14
+ final ,
14
15
)
15
16
import warnings
16
17
28
29
Tick ,
29
30
parsing ,
30
31
)
31
- from pandas ._typing import final
32
32
from pandas .compat .numpy import function as nv
33
33
from pandas .util ._decorators import (
34
34
Appender ,
You can’t perform that action at this time.
0 commit comments