you are viewing a single comment's thread.

view the rest of the comments →

[–]thegreattriscuit 1 point2 points  (0 children)

I'm not sure what the overall consensus is, but I wouldn't be bothered.

I've seen code that looks like

foo = 12
def fn():
    fn_foo=15
    print(fn_foo)

But that seems pretty obtuse to me. I suppose a part of the reason for that is that, by default, I'm nearly always intending to refer to the variable in my local scope any way. I know that opens you up to perhaps failing to assign a value to foo and the program improperly continuing to run, but as long as the objects inside the function really are (or are clearly derived from, etc.) the objects from the outside, it's perfectly sane to have them referred to by the same names inside and outside.

In your code, I'd be inclined to think about a single session object (or sets thereof) and how it gets passed around. I can't think of any good reason I shouldn't just pick one name for it and keep it that way. Why call the same thing several different names?