Incorrect type when descriptors are at different levels in the class hierarchy
bug
When `__get__` and `__set__` are at different levels in the class hierarchy, they do not seem to be behaving properly. Example:
```py
from typing import assert_type, cast, Any
class AttributeGet[ T ]:
def __get__( self, instance: Any, owner: Any = None ) -> T:
return cast( Any, None )
class Attribute[ T, U ]( AttributeGet[ T ] ):
def __set__( self, instance: Any, object: T | U ) -> None:
pass
class StrInt( Attribute[ int, str] ):
pass
class MyContainer:
si: StrInt
c = MyContainer()
c.si = "2"
assert_type( c.si, int ) # ERROR HERE
```
Playground [link](https://pyright-play.net/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoCGAzkQKZ4D68CpANFAMbEz0CCKcAsAFA8MA2xIlFYwYIJACMArjFIBxUjADaUACpQAugC4eUfQBNSwKBQpolZgBRQy-YPVREYBFA1LaRHemADuKck92OCgAXigAOTAAqABKKABaAD51XW59DKgQJWkQFEZmG2D6KJjYnj5BEhExCRk5VTV6AFUtItqpWQUlRq04tIyjEzMyGGtbUntHFGdXdyDvKDBJACtSBhhPDQAfKFb45Mjojz1MqAQhCu4BISgAZXEASRQYdvFOhswX%2BmcQTX7TvoLiQrjdqgBZOAAYWiLlQgUBRCQngeIGeMFBYSgkJhLwI8JAVnK1wAdEisQAiABMFJ4QnIY2opBsDDJSGm%2BGJQA)
0 条评论