Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hierarchy only finds direct subtypes when methods have @override decorator #6885

Open
StellaHuang95 opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@StellaHuang95
Copy link
Contributor

Environment data

  • Pylance version: 2025.1.101
  • Python version (& distribution if applicable, e.g. Anaconda): 3.13

Code Snippet

from abc import ABC, abstractmethod
from typing import override


class A(ABC):
    @abstractmethod
    def method(self):
        pass

class B(A):
     @override
     def method(self): pass

class C(B):
     @override
     def method(self): pass

Repro Steps

  1. Right click on method in class A, show type hierarchy.
  2. Show subtypes of method in A and B.

Expected behavior

method in C should be shown as subtype of method in B

Actual behavior

Image

Logs

XXX
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 23, 2025
@StellaHuang95 StellaHuang95 added bug Something isn't working and removed needs repro Issue has not been reproduced yet labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants