You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider all class fields in stub files to be always magically initialized
Summary:
See [this github issue](#123). Pyrefly currently complains on the following code:
```
class Foo:
x: int
Foo.x # ERROR! Instance-only attribute `x` of class `Foo` is not visible on the class
```
Problem is, typeshed doesn't really differentiate between uninitialized and initialized classlevel field. Meaning that this:
```
class object:
__dict__: dict[str, Any]
```
and this:
```
class object:
__dict__: dict[str, Any] = ...
```
are treated as equivalent (see [this PR](python/typeshed#13875) for further details). Based on the feedback of the PR, this is unlikely to be something that's going to change in the short term. And the suggested action was to avoid reporting the error when the containing class of the field comes from a stub file.
Fixes#123
Reviewed By: rchen152
Differential Revision: D74035159
fbshipit-source-id: 72db88a9506294f4395d049549f3220e6fa2b4c1
0 commit comments