mirror of https://github.com/astral-sh/ruff
## Summary
Add a diagnostic if a pure instance variable is accessed on a class object. For example
```py
class C:
instance_only: str
def __init__(self):
self.instance_only = "a"
# error: Attribute `instance_only` can only be accessed on instances, not on the class object `Literal[C]` itself.
C.instance_only
```
---------
Co-authored-by: David Peter <mail@david-peter.de>
|
||
|---|---|---|
| .. | ||
| assert.md | ||
| attribute.md | ||
| boolean.md | ||
| if.md | ||
| len.md | ||