-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix(typing): mypy errors #204
base: main
Are you sure you want to change the base?
Conversation
Thanks! I'll be able to take a look next week. |
Limited understanding of the project, only the type check part, make some review comments. |
some errors not just about typing. loop on Optional[str] | List[str]
LeanDojo/src/lean_dojo/data_extraction/traced_data.py Lines 872 to 882 in 7f66e93
Node no attribute name
LeanDojo/src/lean_dojo/data_extraction/traced_data.py Lines 632 to 636 in 7f66e93
check instance type IdentNode, CommandTheoremNode, StdTacticAliasAliaslrNode but Node and these SubNode, doesn't has attribute name. TracedTactic ast node with Optional[Pos]
but should i check
|
slice not raise error. when index with None, but should not use operator on None
check type for node class property. Generator has incompatible item type "str | None"; expected "str"
Item "None" of "Any | str | list[str] | None" has no attribute "iter" (not iterable)
is_mutual_type want filter |
always use
so node input is_mutual_lean4 always subset of node input is_potential_premise_lean4: potential_premise -> subset node type only StdTacticAliasAliaslrNode change is_mutual_type ,only check isinstance StdTacticAliasAliaslrNode |
hi, @yangky11
|
Sorry I've been swamped recently but will take a look when I get a chance! |
It's okay. Related projects are developing rapidly and it works fine now. Type checking is not a priority. |
Involved Issue
Close #196
Note
from_data
orfrom_xml
. use Generic[T].child[x]
use cast pass some mypy check if varibale afterassert check
execute
if return None, cant slice. raise Error.Need Discus
is_potential_premise_lean4
node doesn't have nameis_mutual_lean4
loop onfullname: Optional[str]
and set as full_name seams weird.