Python inner function parameter shadowed

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Sep 14 03:30:03 EDT 2016


On Wednesday 14 September 2016 13:58, Lawrence D’Oliveiro wrote:

> On Wednesday, September 14, 2016 at 4:34:34 AM UTC+12, Daiyue Weng wrote:
>> PyCharm warns about "Shadows name 'func' from outer scope"
> 
> Typical piece of software trying to be too helpful and just getting in the
> way.
> 
> Can you turn off such warnings?

Yes.

It is the job of the linter to be pedantic and opinionated. A good linter will
let you turn off warnings globally and locally, permanently and temporarily. I
don't know how good PyCharm is, but you can certainly configure it to turn off
selected warnings:

https://www.jetbrains.com/help/pycharm/2016.1/disabling-and-enabling-inspections.html

https://www.jetbrains.com/help/pycharm/2016.1/suppressing-inspections.html




-- 
Steven
git gets easier once you get the basic idea that branches are homeomorphic
endofunctors mapping submanifolds of a Hilbert space.




More information about the Python-list mailing list