Python: When passing variables between methods, is it necessary to assign it a new name?
- by Anthony
I'm thinking that the answer is probably 'no' if the program is small and there are a lot of methods, but what about in a larger program? If I am going to be using one variable in multiple methods throughout the program, is it smarter to:
Come up with a different phrasing for each method (to eliminate naming conflicts).
Use the same name for each method (to eliminate confusion)
Just use a global variable (to eliminate both)
This is more of a stylistic question than anything else. What naming convention do YOU use when passing variables?