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

Pylint flags imports for lingua #249

Open
sanmai-NL opened this issue Dec 17, 2024 · 2 comments
Open

Pylint flags imports for lingua #249

sanmai-NL opened this issue Dec 17, 2024 · 2 comments

Comments

@sanmai-NL
Copy link

src/app/data/unstructured/document/__init__.py:12:

from lingua import Language, LanguageDetectorBuilder
src/app/data/unstructured/document/__init__.py:12:0: E0611: No name 'Language' in module 'lingua' (no-name-in-module)
src/app/data/unstructured/document/__init__.py:12:0: E0611: No name 'LanguageDetectorBuilder' in module 'lingua' (no-name-in-module)

lingua/__init__.py:

from .lingua import *

__doc__ = lingua.__doc__
if hasattr(lingua, "__all__"):
    __all__ = lingua.__all__

Perhaps because this dynamic style of declaring exports is rather unusual or tricky for Pylint. Are you open to something to be done about this on Lingua's side?

@pemistahl pemistahl transferred this issue from pemistahl/lingua Dec 17, 2024
@pemistahl
Copy link
Owner

What version of Lingua are you using? 2.0? It turns out that one needs to specify the module name explicitly in the Python bindings which I just did to enable pickling. So even though I have no experience with Pylint I guess your error will be gone in the next release 2.1.0.

@sanmai-NL
Copy link
Author

@pemistahl The fault occurs with lingua-language-detector 2.0.2 under pylint 3.3.2.

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

No branches or pull requests

2 participants