mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
![]() ## Summary Add support for `typing.ClassVar`, i.e. emit a diagnostic in this scenario: ```py from typing import ClassVar class C: x: ClassVar[int] = 1 c = C() c.x = 3 # error: "Cannot assign to pure class variable `x` from an instance of type `C`" ``` ## Test Plan - New tests for the `typing.ClassVar` qualifier - Fixed one TODO in `attributes.md` |
||
---|---|---|
.. | ||
mdtest | ||
README.md |
Markdown files within the mdtest/
subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs
integration test.
See crates/red_knot_test/README.md
for documentation of this test format.