ruff
da4be789 - [ty] Ignore `ClassVar` declarations when resolving instance members (#18241)

Commit
205 days ago
[ty] Ignore `ClassVar` declarations when resolving instance members (#18241) ## Summary Make sure that the following definitions all lead to the same outcome (bug originally noticed by @AlexWaygood) ```py from typing import ClassVar class Descriptor: def __get__(self, instance, owner) -> int: return 42 class C: a: ClassVar[Descriptor] b: Descriptor = Descriptor() c: ClassVar[Descriptor] = Descriptor() reveal_type(C().a) # revealed: int (previously: int | Descriptor) reveal_type(C().b) # revealed: int reveal_type(C().c) # revealed: int ``` ## Test Plan New Markdown tests
Author
Parents
Loading