basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

`reportUnusedFunction` false negative on protected methods of `@final` classes

Open DetachHead opened this issue 1 year ago • 1 comments

Code sample in basedpyright playground

from typing import final

def _foo(): # error
    ...

@final
class Foo:
    def _foo(self): ... # no error

DetachHead avatar Aug 08 '24 05:08 DetachHead

upstream issue: https://github.com/microsoft/pyright/issues/4951

the reason it was rejected was because a subclass could use it, but it should at least work on @final classes

DetachHead avatar Aug 12 '24 02:08 DetachHead