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_def
isn't copying over theis_generator
,is_coroutine
, andis_awaitable_coroutine
attributesvisit_var
isn't copying over theis_suppressed_import
attributevisit_with_statement
isn't copying overis_async
visit_class_def
isn'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).