-
Notifications
You must be signed in to change notification settings - Fork 205
Closed
Labels
Description
Describe the Bug
When I get the type of None (which should be types.NoneType), Pyrefly fails to resolve attributes on it. This prevents me from accessing methods like bool on type[None].
Code Snippet:
def ty[T](x: T) -> type[T]: ...
# Try to access __bool__ method on type[None]
none_type = ty(None)
result = none_type.__bool__(None)
Expected Behavior:
- ty(None) returns type[None]
- type[None] should be equivalent to types.NoneType
- types.NoneType is a real Python class with methods like bool
- Therefore, none_type.bool(None) should be valid
I am getting ERROR: Expr::attr_infer_for_type attribute base undefined
Pyrefly cannot resolve the bool attribute on type[None].
Sandbox Link
(Only applicable for extension issues) IDE Information
No response