Adding an __all__ variable to control the set of variables exported by lingua. This helps with type checking by Pyright. The alternative would be changing to a form such as: from .builder import LanguageDetectorBuilder as LanguageDetectorBuilder
Imported symbols are considered private by default. If they use the “import A as A” (a redundant module alias), “from X import A as A” (a redundant symbol alias), or “from . import A” forms, symbol “A” is not private unless the name begins with an underscore. If a file init.py uses the form “from .A import X”, symbol “A” is not private unless the name begins with an underscore (but “X” is still private). If a wildcard import (of the form “from X import *”) is used, all symbols referenced by the wildcard are not private.
Thanks for making lingua!
Adding an
__all__
variable to control the set of variables exported by lingua. This helps with type checking by Pyright. The alternative would be changing to a form such as:from .builder import LanguageDetectorBuilder as LanguageDetectorBuilder
https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
I assume this only started happening with releases following: https://github.com/pemistahl/lingua-py/issues/63