diff --git a/demo_code.py b/demo_code.py index 9fde50644..056037d08 100644 --- a/demo_code.py +++ b/demo_code.py @@ -126,7 +126,7 @@ def chained_comparison(): if __name__ == "__main__": args = ["--disable", "all"] - for i in range(len(args)): - has_truthy = True if args[i] else False + for i, element in enumerate(args): + has_truthy = True if element else False if has_truthy: break diff --git a/hello.py b/hello.py index dc8227b07..aed186ee4 100644 --- a/hello.py +++ b/hello.py @@ -73,6 +73,7 @@ def get_users(): return User.objects.annotate(val=RawSQL(raw, [])) + def tar_something(): os.tempnam("dir1") subprocess.Popen("/bin/chown *", shell=True) @@ -122,8 +123,8 @@ def chained_comparison(): f.write("config file.") f.close() assert args is not None - for i in range(len(args)): - has_truthy = True if args[i] else False + for i, element in enumerate(args): + has_truthy = True if element else False assert has_truthy is not None if has_truthy: break