David Peter
da4be789ef
[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
2025-05-21 19:23:35 +02:00
..
2025-05-12 22:02:25 -04:00
2025-05-19 19:47:31 +02:00
2025-05-12 22:12:44 -04:00
2025-05-17 08:27:32 -04:00
2025-05-06 20:11:25 -04:00
2025-05-14 22:51:23 -04:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-21 18:16:25 +02:00
2025-05-14 22:48:33 -04:00
2025-05-09 13:40:51 -04:00
2025-05-19 18:13:34 -04:00
2025-05-09 17:39:15 +01:00
2025-05-14 08:26:48 +02:00
2025-05-19 15:42:54 -04:00
2025-05-21 07:28:33 +00:00
2025-05-09 17:39:15 +01:00
2025-05-03 19:49:15 +02:00
2025-05-17 08:27:32 -04:00
2025-05-03 19:49:15 +02:00
2025-05-15 22:01:38 +02:00
2025-05-03 19:49:15 +02:00
2025-05-21 11:06:27 -04:00
2025-05-06 20:11:25 -04:00
2025-05-20 16:44:12 +02:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-20 14:11:03 -04:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-21 19:23:35 +02:00
2025-05-13 21:27:48 +00:00
2025-05-07 15:51:13 +02:00
2025-05-15 14:27:23 +02:00
2025-05-09 13:40:51 -04:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-06 12:37:10 +01:00
2025-05-06 20:11:25 -04:00
2025-05-16 06:57:26 +02:00
2025-05-16 12:56:43 +02:00
2025-05-03 19:49:15 +02:00
2025-05-19 16:36:49 +02:00
2025-05-09 13:40:51 -04:00
2025-05-09 17:39:15 +01:00
2025-05-03 19:49:15 +02:00
2025-05-09 14:57:14 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00