We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0aa4867 commit 8cdac52Copy full SHA for 8cdac52
1 file changed
mypy/messages.py
@@ -510,12 +510,12 @@ def has_no_attr(
510
code=codes.ATTR_DEFINED,
511
)
512
failed = True
513
- elif isinstance(typ, Instance) and typ.type.names:
+ elif isinstance(typ, Instance) and typ.type.names:
514
alternatives = set(typ.type.names.keys())
515
alternatives.discard(member)
516
matches = [m for m in COMMON_MISTAKES.get(member, []) if m in alternatives]
517
matches.extend(best_matches(member, alternatives, n=3))
518
- if matches:
+ if matches:
519
self.fail(
520
'{} has no attribute "{}"; maybe {}?{}'.format(
521
format_type(original_type, self.options),
0 commit comments