facebook / facebook/pyrefly

`reportPrivateUsage` from pyright is not covered by `no-access`

Open
#3,659 1 comment 0 reactions 0 assignees View on GitHub
help wanted typechecking
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

[the error kind mapping](https://pyrefly.org/en/docs/migrating-from-pyright/#error-kind-mapping) says `reportPrivateUsage` is covered by `no-access` but that doesn't seem to be the case:

```py
class Foo:
def _foo(self): ...
def __bar(self): ...

foo = Foo()

foo._foo() # no error
foo.__foo() # missing-attribute
```
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQBiuuiAOgE5vr2-2Yww9APpgWACjgwoYAJSJ6hJZ259%2BgkcOyoOk6XIVLCKnnxNjc9ALxMJsk%2BZaFRd%2BgGJ66SzA4dcXLnQLZxdccVl3egBbCDoIdABzAFpUABdUjghsAFdUmBAAGhAyDkEoUkJU3CioCg8ABVJSsHL6NCw8fHpKXCCIBOyONIhe43QPAGUYGHoAC3TiOEQAemWSsor-BOWYdGXMXEo4ZZ6%2BgaHUkb36MQ56VAA3VGhUbFhu3shz4d76XGJLr04GMyKlZr0kg8fHArtZ6GwQABmQgARgATAjuABtHx%2BDhwAC63Gy6AgUWI-jymCSmAgpUolyhcIA5P0vKVmdwvKkkqUAI7ZOkwakAaxgpBSlEo8AYNmZAHcdOhOaTyVAIJQIDyMKQWbj-CqYPhiOrNdr0Lq5fqOMyQABfIqoBkQKGMaD5RAgdo4Agkch2oA

note that confusingly, `reportPrivateUsage` actually only really applies to protected members, not private members, which are instead covered by `reportAttributeAccessIssue`. [basedpyright playground](https://basedpyright.com/?pyrightVersion=1.39.5&typeCheckingMode=all&reportUnusedParameter=false&reportUnknownMemberType=false&reportUnusedFunction=false&code=MYGwhgzhAEBiD28BcBYAUNT0AmBTAZtAPr6IAUEuI%2BAlEtAHRPpY4HFEBGYAThVbXpMGLLOlLxoAXjjka6cYgYk50AMTQeuAA7weAFwAKPAJYA3MPtwBVCGADmuRfGUr4ZGus069%2BgIL6%2BqacAK5WfsDAuFAAklAhuEA)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.