Replies: 1 comment
-
Pyright is working as intended here, so I don't consider this a bug. To get the effect that you're looking for, class MyClass2(MyClass1):
def public_meth(self) -> None:
return self._private_meth() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Perhaps this is the intended functionality, but noticed that you aren't able to use a private method through
self
annotated with a protocol, take this example:Pyright Playground
From my point of view, in cases where
self
is being annotated with a protocol (such as in the cases of mixin, for which it's a common strategy) it would be able to make sense to access private methods without running into warnings, but perhaps there is a reason why this is the case.Beta Was this translation helpful? Give feedback.
All reactions