Is there anything wrong with the following?:
def foo(bar):
for b in bar:
print (b)
bar = ['hello', 'world']
foo(bar)
Often in my code I change the function parameters to a name that differs from the passed variable.
def foo(_bar):
for b in _bar:
print (b)
bar = ['hello', 'world']
foo(bar)
I do this just to be safe, but when other people look at the code, I think it would be great if I can keep the same name so they know exactly what is being passed.