Skip to content
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

Commit c74b476

Browse files
committed
fixup typing
1 parent 8397722 commit c74b476

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

pandas_dev_flaker/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def run(
16-
tree: ast.AST,
16+
tree: ast.Module,
1717
file_tokens: Sequence[tokenize.TokenInfo],
1818
) -> Iterator[Tuple[int, int, str, str]]:
1919
callbacks_tree = visit_tree(FUNCS_TREE, tree)

pandas_dev_flaker/_data_tokens.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
Sequence,
1212
Set,
1313
Tuple,
14-
TypeVar,
1514
)
1615

1716
if TYPE_CHECKING:
@@ -27,27 +26,26 @@ class State(NamedTuple):
2726
in_annotation: bool = False
2827

2928

30-
TOKENS_T = TypeVar("TOKENS_T", bound=Sequence[tokenize.TokenInfo])
31-
TokensFunc = Callable[[TOKENS_T], Iterable[Tuple[int, int, str]]]
29+
TokensFunc = Callable[
30+
[Sequence[tokenize.TokenInfo]],
31+
Iterable[Tuple[int, int, str]],
32+
]
3233

3334

3435
FUNCS_TOKENS = []
3536

3637

37-
TokensCallbackMapping = List[TokensFunc[TOKENS_T]]
38-
39-
40-
def register() -> Callable[[TokensFunc[TOKENS_T]], TokensFunc[TOKENS_T]]:
41-
def register_decorator(func: TokensFunc[TOKENS_T]) -> TokensFunc[TOKENS_T]:
38+
def register() -> Callable[[TokensFunc], TokensFunc]:
39+
def register_decorator(func: TokensFunc) -> TokensFunc:
4240
FUNCS_TOKENS.append(func)
4341
return func
4442

4543
return register_decorator
4644

4745

4846
def visit_tokens(
49-
funcs: List[TokensFunc[TOKENS_T]],
50-
tokens: TOKENS_T,
47+
funcs: List[TokensFunc],
48+
tokens: Sequence[tokenize.TokenInfo],
5149
) -> Iterator[Tuple[int, int, str]]:
5250
"Step through tree, recording when nodes are in annotations."
5351
for token_func in funcs:

0 commit comments

Comments
 (0)