# Unused entries
for entry in flow.entries:
if (not entry.cf_references
- and not entry.is_pyclass_attr
- and not entry.in_closure):
+ and not entry.is_pyclass_attr):
if entry.name != '_':
# '_' is often used for unused variables, e.g. in loops
if entry.is_arg:
def unused_generic(*args, **kwargs):
pass
+def unused_in_closure(a,b,c):
+ x = 1
+ def inner():
+ nonlocal c
+ c = 1
+ y = 2
+ return a+b
+ return inner()
+
+
_ERRORS = """
6:6: Unused entry 'a'
9:9: Unused entry 'b'
36:13: Unused entry 'i'
38:20: Unused argument 'args'
38:28: Unused argument 'kwargs'
+41:26: Unused argument 'c'
+41:26: Unused entry 'c'
+42:6: Unused entry 'x'
+46:10: Unused entry 'y'
"""