On 10/11/2016 11:50 AM, Daiyue Weng wrote:
Hi, I have the following code structure,
def one_func(param1, param2, param3):
process_outcome = {'dict': None}
outcome = another_func(param1, process_outcome, db_host=param2,
funcs_to_run=param3)
PyCharm warns me
Shadows name from outer scope
on every variable here, param1,2,3, process_outcome.
Have you checked that this is true? Code checkers sometimes have bugs.
In any case, we cannot comment on this without code.
I am wondering how to resolve the issues,
Ignore the warning or turn it off.
and is it vital to have variables not shadowed?
No, sometimes it is the right thing to do. Some warnings dependably
indicate something wrong. Some do not and are just a hint that maybe
you should think about what you did. Was it accidental (a typo) or
intentional?
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list