Skip to content

Missing union type in attr base #655

Open
@migeed-z

Description

@migeed-z

Describe the Bug

from typing import Any, Tuple

def g(ann) -> None:
    if ann is Tuple: ...
    ann.__module__ # E: TODO: Expr::attr_infer_for_type attribute base undefined for type: type[Tuple] | Unknown (trying to access __module__)

This should not be an error. We are not handling things properly and may need to add a new variant to attr base.

Sandbox Link

https://pyrefly.org/sandbox/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoCCKcANFACoCuCANgKYBQDAJncFGgBQCGKKAlFAC0APigA5MCjoAuBlAWZ2vFJgDOFavRlQAdPvmKVugPomIYZpXpmoAYigBRHeQDyAEVc7HADwQgZGW4YGBATVGA6MOBcE3gEOihg0KQAI0oYRNTuNUTKFFZgVDpmKBiQWERZSoSAbSpaOgBdKAAfKABVFABrFDAAd1VOULhUDBgwJIBjKbo1DTMLKxsTfiA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions