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
When I am importing and using Logger class (for typing purposes) as shown below, I am getting an import error like ImportError: cannot import name 'Logger' from 'loguru'.
Loguru references type hints through a stub file only. The types are not accessible at run-time, they only exist in the context of type checkers execution.
You should use postponed evaluation of type hints, either using strings:
When I am importing and using Logger class (for typing purposes) as shown below, I am getting an import error like
ImportError: cannot import name 'Logger' from 'loguru'
.Turns out it is imported as _Logger in
__init__.py
and thereby a mismatch between type and definition.loguru/loguru/__init__.py
Line 12 in 70e9df2
The text was updated successfully, but these errors were encountered: