Skip to content

Conversation

@KevinRK29
Copy link
Collaborator

This PR adds fuzzy matching suggestions when accessing invalid enum members, similar to the existing behavior for module imports and instance attributes.

@KevinRK29 KevinRK29 requested a review from JukkaL January 30, 2026 06:55
@github-actions

This comment has been minimized.


Color.GREN # E: "type[Color]" has no attribute "GREN"; maybe "GREEN"?
Color.YELOW # E: "type[Color]" has no attribute "YELOW"; maybe "YELLOW"?
Color.RDE # E: "type[Color]" has no attribute "RDE"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't trigger fuzzy matching due to it being below the 0.75 threshold in best_matches

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/flow_engine.py:1703: error: "R" has no attribute "__anext__"  [attr-defined]
+ src/prefect/flow_engine.py:1703: error: "R" has no attribute "__anext__"; maybe "__ne__"?  [attr-defined]
- src/prefect/task_engine.py:1794: error: "R" has no attribute "__anext__"  [attr-defined]
+ src/prefect/task_engine.py:1794: error: "R" has no attribute "__anext__"; maybe "__ne__"?  [attr-defined]

colour (https://github.com/colour-science/colour)
- colour/utilities/network.py:154: error: "Self" has no attribute "_id"  [attr-defined]
+ colour/utilities/network.py:154: error: "Self" has no attribute "_id"; maybe "id"?  [attr-defined]

zulip (https://github.com/zulip/zulip)
+ zerver/models/push_notifications.py:73: error: "type[TokenKind]" has no attribute "choices"  [attr-defined]
+ zerver/models/push_notifications.py:114: error: "type[ErrorCode]" has no attribute "choices"  [attr-defined]
+ zerver/models/messages.py:53: error: "type[MessageType]" has no attribute "choices"  [attr-defined]
+ zerver/models/user_topics.py:44: error: "type[VisibilityPolicy]" has no attribute "choices"  [attr-defined]

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/__init__.py:1275: error: "None" has no attribute "__iter__" (not iterable)  [attr-defined]
+ ibis/backends/__init__.py:1275: error: "None" has no attribute "__iter__"; maybe "__dir__" or "__str__"? (not iterable)  [attr-defined]
- ibis/backends/clickhouse/__init__.py:253: error: "None" has no attribute "__iter__" (not iterable)  [attr-defined]
+ ibis/backends/clickhouse/__init__.py:253: error: "None" has no attribute "__iter__"; maybe "__dir__" or "__str__"? (not iterable)  [attr-defined]

apprise (https://github.com/caronc/apprise)
- apprise/persistent_store.py:1324: error: "None" has no attribute "__iter__" (not iterable)  [attr-defined]
+ apprise/persistent_store.py:1324: error: "None" has no attribute "__iter__"; maybe "__dir__" or "__str__"? (not iterable)  [attr-defined]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant