Skip to content

lingua classes appear to Python to be in builtins module, not lingua module #255

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

Closed
brettrp opened this issue Feb 13, 2025 · 1 comment
Closed
Milestone

Comments

@brettrp
Copy link

brettrp commented Feb 13, 2025

I'm not sure whether this is a result of how the Rust mappings are done, but the lingua classes appear to Python to be in the builtins module:

from lingua import IsoCode639_1, LanguageDetectorBuilder

print(f"{IsoCode639_1.__module__=} {LanguageDetectorBuilder.__module__=}")


IsoCode639_1.__module__='builtins' LanguageDetectorBuilder.__module__='builtins'

This means that, for example, pylint gets confused:

% pylint lingua_test.py
************* Module lingua_test
lingua_test.py:1:0: E0611: No name 'IsoCode639_1' in module 'lingua' (no-name-in-module)
lingua_test.py:1:0: E0611: No name 'LanguageDetectorBuilder' in module 'lingua' (no-name-in-module)
@pemistahl
Copy link
Owner

I've fixed that already as well. Will be part of the next release.

@pemistahl pemistahl added this to the Lingua 2.1.0 milestone Mar 20, 2025
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