Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Auto-fix for Module has no attribute "findAll"; maybe "findall"? Mypy(attr-defined) #345

Closed
hamirmahal opened this issue Feb 16, 2025 · 3 comments
Assignees

Comments

@hamirmahal
Copy link
Contributor

Problem

Extension users have to manually correct misspelled APIs, .e.g,

Module has no attribute "findAll"; maybe "findall"? Mypy(attr-defined)

Suggested Solution

There is an option in the Quick Fix... dropdown in VSCode that automatically suggests the appropriate APIs, like findall in the above example.

@hamirmahal
Copy link
Contributor Author

Image

@hamirmahal
Copy link
Contributor Author

"""
An auto-fix for `re.findAll` would be nice.
"""

import re


def main() -> None:
    """
    `Module has no attribute "findAll"; maybe "findall"? Mypy(attr-defined)`
    """
    expression = "[a-e]"
    text = "The quick"
    result = re.findAll(expression, text)
    print(result)


if __name__ == "__main__":
    main()

@karthiknadig
Copy link
Member

@hamirmahal I marked this as a duplicate of an issue that I moved to pylance. Since this feature request on mypy and the one you created in pylint both can be handled and resolved generically by pylance. In pylance it can handle this even in the absence of either linters.

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

No branches or pull requests

2 participants