TransformVisitor (and StrConv) are slightly out-of-sync with node definitions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Review TransformVisitor in mypy.treetransform and StrConv in mypy.strconv against the node definitions in mypy.nodes; start with the listed visitor methods and attributes. Check related visitors for similar mismatches, then add coverage that detects missing copied attributes and verify the listed cases are handled.
Written by the indexing model from the issue text.
Description
I recently noticed that mypy.treetransform.TransformVisitor seems to be slightly out-of-sync with the nodes within mypy.nodes.
For example...
visit_func_defisn't copying over theis_generator,is_coroutine, andis_awaitable_coroutineattributesvisit_varisn't copying over theis_suppressed_importattributevisit_with_statementisn't copying overis_asyncvisit_class_defisn't copying overhas_incompatible_baseclass
Currently, it doesn't seem like these omissions are too harmful since the only place we use TransformVisitor is within TypeTransformVisitor (which only expands types). However, I could see this might lead to subtle bugs in the future, so it's probably worth fixing this now and perhaps coming up with some sort of test that will automatically catch these sorts of discrepancies in the future.
mypy.strconv.StrConv also seems to have similar issues, though it's probably even less of a priority. I haven't really checked the other visitors, so I don't know if they're similarly desynched.
(I'm filing this issue to make sure I don't forget about it).
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 54
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python/mypy
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug topic-configuration topic-error-reporting
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100