Skip to content

Look at flake8 B906 #552

@enzbang

Description

@enzbang

Flake8 flags some code with the B906 check:

B906: visit_ function with no further call to a visit function. This is often an error, and will stop the visitor from recursing into the subnodes of a visited node. Consider adding a call self.generic_visit(node) at the end of the function. Will only trigger on function names where the part after visit_ is a valid ast type with a non-empty _fields attribute. This is meant to be enabled by developers writing visitors using the ast module, such as flake8 plugin writers.

See

src/e3/sys.py:122:5: B906 `visit_` function with no further calls to a visit function, which might prevent the `ast` visitor from properly visiting all nodes. Consider adding a call to `self.generic_visit(node)`.
and
src/e3/sys.py:127:5: B906 `visit_` function with no further calls to a visit function, which might prevent the `ast` visitor from properly visiting all nodes. Consider adding a call to `self.generic_visit(node)`.

We need to review that warning to see whether that's a false positive or a real bug in e3.sys

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueSmall task that can be performed by new or casual contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions