Skip to content

Duplicate errors for undefined name in __all__ #2655

@rchen152

Description

@rchen152

Describe the Bug

If a module's __all__ attribute contains a name that pyrefly can't resolve, it reports a bad-dunder-all error on the __all__ definition, then a missing-module-attribute error on a star-import of the module.

IMO we shouldn't report the latter: it may not be actionable (if you're importing from a third-party library, it's not easy to go in and fix __all__), and it's redundant with the bad-dunder-all error.

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEArgC7Rx0Q3G6VN0BUIADQhmrEuUQgA%2BlNRQoMugF46AbQA6IAMKaAukJBlKMMFFKEmtKBQDEdAAqljp0nTRY8%2BOgGNc6SADmDJSoLH6E6uh2AMowMHQAFkxMxHCIAPTpRiZmhNwB6TDo6Zi43nDpvv4QQSFhxXRg3HSoAG6o0KjYsD5%2BgcGhEH50uMT1cBHoZEwJfgC0rTCUcEPoynSaAMyEAIwATJqRIAC%2BwqjeLIsAYtAwFO44BOInQA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions