169 match operation:
170 case "add":
171 matches_this_week = request_user_profile.matches_this_week.all()
172 for username in request.data["circle"]:173 user_profile = SocialProfile.objects.get(
174 user__username=username
175 )
A local name is redefining an argument, which might suggest a potential error. This is taken into account only for a handful of name binding operations, such as for
iterations, with
statements, and exception handler assignments.
def print_files(filename):
with open(filename) as f:
files = f.readlines()
for filename in files: # `filename` is already defined outside!
print(filename)
def print_files(filename):
with open(filename) as f:
files = f.readlines()
for file in files: # renamed it to `file` to avoid conflict
print(file)