Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate collections which are hard to infer types for #1069

Merged

Conversation

plannigan
Copy link
Contributor

@plannigan plannigan commented Jan 8, 2022

Resolves

lark/lexer.py:481: error: Need type annotation for "lexer_by_tokens" (hint: "lexer_by_tokens: Dict[<type>, <type>] = ...")  [var-annotated]
lark/load_grammar.py:1070: error: Need type annotation for "_definitions" (hint: "_definitions: Dict[<type>, <type>] = ...")  [var-annotated]
lark/load_grammar.py:1071: error: Need type annotation for "_ignore_names" (hint: "_ignore_names: List[<type>] = ...")  [var-annotated]
lark/load_grammar.py:1213: error: Need type annotation for "imports" (hint: "imports: Dict[<type>, <type>] = ...")  [var-annotated]

They all seem to be cases where updates to the collection happen outside of the function or in odd branches of code paths.

@erezsh erezsh requested a review from MegaIng January 9, 2022 08:26
@erezsh erezsh merged commit cc42307 into lark-parser:master Jan 9, 2022
@plannigan plannigan deleted the mypy_fix-additional_annotations branch January 9, 2022 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants