I frequently find myself wondering if there is any best practice for the following situation.
Let’s say, I want to access local files within my Python script and, therefore, create a global variable path pointing at the dataset.
Now I’m writing a function which should have a path variable as an argument.
I know that the local variable within the function shadows the global variable but I just find it unsatisfying to write path=path.
I think I remember seeing that people just write an underscore before the local variable like in _path=path.
Is that a thing?
Is there any best practice?
How do you name your function arguments that have the same name as a global argument?
Best
Jo