MCPcopy Index your code
hub / github.com/ebeweber/flake8-mutable / run

Method run

mutable_defaults.py:30–42  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 self.tree = tree
29
30 def run(self):
31 for node in ast.walk(self.tree):
32 if isinstance(node, ast.FunctionDef):
33 for default in node.args.defaults:
34 if any([
35 isinstance(default, mutable_type)
36 for mutable_type in mutable_types
37 ]):
38 error_msg = self._error_tmpl.format(
39 self._code, type(default).__name__
40 )
41 yield (default.lineno, default.col_offset,
42 error_msg, type(self))

Callers 2

test_mutable_defaultsFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_mutable_defaultsFunction · 0.64