You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, you should preferably not use from loguru._logger import Logger. This is an internal type that is not supposed to be exposed publicly. You'll also miss many of the other types listed in the documentation: Type hints.
You're facing ImportError because the Loguru types being defined in a stub file, they're only accessible to type checkers, not at run-time.
Wondering, how do you typehint a logger being passed around in code?
I tried using
:Logger
by importingfrom loguru import Logger
but it gives me a "ImportError: cannot import name 'Logger' from 'loguru'" errorCouldn't find a clear answer here either: https://stackoverflow.com/questions/66411218/type-hint-for-returning-loguru-logger
The text was updated successfully, but these errors were encountered: