Handle corner case: protocol vs classvar vs descriptor by ilevkivskyi · Pull Request #19277 · python/mypy

@ilevkivskyi

@ilevkivskyi mentioned this pull request

Jun 11, 2025

@ilevkivskyi

@ilevkivskyi

esarp pushed a commit that referenced this pull request

Jul 3, 2025
Ref #19274

This is a bit ugly. But I propose to have this "hot-fix" until we have a
proper overhaul of instance vs class variables. To be clear: attribute
access already works correctly (on both `P` and `Type[P]`), but
subtyping returns false because of
```python
                elif (IS_CLASSVAR in subflags) != (IS_CLASSVAR in superflags):
                    return False
```