Skip to content

Fine grained mode should respect __getattr__ #4936

@ilevkivskyi

Description

@ilevkivskyi

Currently this fine grained test fails:

[case testGetAttrFine]
from a import A
x: A
y: int = x.x
[file a.py]
class A:
    def __getattr__(self, attr: str) -> int:
        pass
[file a.py.2]
class A:
    def __getattr__(self, attr: str) -> str:
        pass
[out]
==
main:3: error: Incompatible types in assignment (expression has type "str", variable has type "int")

We need to trigger wildcard trigger on class or module if its __getattr__ is triggered. Also we need to be sure that this (chaining wildcard and normal deps <Base.__getattr__> -> <Base[wildcard]> and <Base.x> -> <Sub.x> etc.) works correctly on subclasses.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions