Python: When passing variables between methods, is it necessary to assign it a new name?

Posted by Anthony on Stack Overflow See other posts from Stack Overflow or by Anthony
Published on 2010-05-21T22:37:50Z Indexed on 2010/05/21 22:40 UTC
Read the original article Hit count: 218

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about python

Related posts about methods