Ignore any unused entry that starts with '_'.

This makes it possible to follow PEP8 which recommends '__',
and to name unused entries, e.g.:

    foo, _bar, _zed = func()
parent 43d26ad8
...@@ -634,7 +634,7 @@ def check_definitions(flow, compiler_directives): ...@@ -634,7 +634,7 @@ def check_definitions(flow, compiler_directives):
for entry in flow.entries: for entry in flow.entries:
if (not entry.cf_references if (not entry.cf_references
and not entry.is_pyclass_attr): and not entry.is_pyclass_attr):
if entry.name != '_': if not entry.name.startswith('_'):
# '_' is often used for unused variables, e.g. in loops # '_' is often used for unused variables, e.g. in loops
if entry.is_arg: if entry.is_arg:
if warn_unused_arg: if warn_unused_arg:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment