ruff/crates/red_knot_python_semantic/resources/mdtest/expression
Mike Perlov 68991d09a8
[red-knot] Add diagnostic for class-object access to pure instance variables (#16036)
## 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>
2025-02-24 15:17:16 +01:00
..
assert.md [red-knot] Diagnostics for incorrect bool usages (#16238) 2025-02-21 19:26:05 +01:00
attribute.md [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00
boolean.md [red-knot] Add diagnostic for class-object access to pure instance variables (#16036) 2025-02-24 15:17:16 +01:00
if.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
len.md [red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674) 2025-01-24 12:47:48 +01:00