-
Notifications
You must be signed in to change notification settings - Fork 284
Labels
typecheckingusabilityUsability & readiness issues identified with running Pyrefly on top OSS projectsUsability & readiness issues identified with running Pyrefly on top OSS projectsv1-consider-addingTop-ranked but not in V1 milestone (consider adding)Top-ranked but not in V1 milestone (consider adding)
Description
Describe the Bug
Minimal repro:
class ActorHandle[T]:
"""Wrapper returned by the @remote decorator."""
def remote(self) -> T: ...
def options(self, num_cpus: int) -> "ActorHandle[T]": ...
def remote[T](cls: type[T]) -> ActorHandle[T]:
"""Decorator that replaces a class with an ActorHandle wrapper."""
return ActorHandle()
@remote
class Worker:
def compute(self) -> int:
return 42
# After decoration, Worker is ActorHandle[Worker], so .remote() is valid
Worker.remote() # pyrefly: Class `Worker` has no class attribute `remote`
Worker.options(num_cpus=2) # pyrefly: Class `Worker` has no class attribute `options`Today only Pyright actually accepts this kind of code. So low-pri.
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
typecheckingusabilityUsability & readiness issues identified with running Pyrefly on top OSS projectsUsability & readiness issues identified with running Pyrefly on top OSS projectsv1-consider-addingTop-ranked but not in V1 milestone (consider adding)Top-ranked but not in V1 milestone (consider adding)