Type annotation for slice
11 Dec
2020
11 Dec
'20
2:53 a.m.
(it is formerly discussed in https://discuss.python.org/t/is-it-a-good-practice-to-pass-tuple-of-slice-to... ) Currently we cannot write type annotation for slice like `slice[str, str]`. And it is useful when write something like `a["C1":"C2"]` , which is used in pandas already. And I also want to write something like `a[(1,2):4,(5,6):9]` which type could be `tuple[slice[tuple[int, int], int, None], ...]` So I think it would be better if slice support type annotation
1224
Age (days ago)
1226
Last active (days ago)
9 comments
3 participants
participants (3)
-
Guido van Rossum
-
Hao Zhang
-
Jelle Zijlstra