Member <anything> may be missing on module `torch.distributed`
Summary
import torch.distributed as tdist
tdist.all_gather # complains on all ops I use: get_rank / get_world_size / ...
while this seemingly works
from torch.distributed import ...
Version
ty 0.0.7
I'm not sure what the issue is exactly but all other type checkers that I tested (Pylance, Pyrefly) don't raise the same diagnostic.
We have already disabled possibly-unresolved-reference and possibly-missing-import by default, due to the likelihood of false positives when libraries do complex conditional imports. (The latter being disabled by default is I think the only reason from torch.distributed import ... shows no issue here.) So for consistency I think we should also disable possibly-missing-attribute by default, otherwise you get this weird inconsistency where the import version is fine but the attribute version is not.
for consistency I think we should also disable
possibly-missing-attributeby default, otherwise you get this weird inconsistency where the import version is fine but the attribute version is not.
We cannot do that without first tackling https://github.com/astral-sh/ty/issues/1656