Consider the following example
# some_module.py
"""Module docstring
Attributes
----------
logger : logging.Logger
"""
import logging
logger = logging.getLogger(__name__)
Currently, referencing logging.Logger for the attribute will be reported as an "unknown name" and is replaced with from typing import Any as logging_Logger. Instead import logging could be treated as a module-scoped
[tool.docstub.known_imports]
logging = {import = "logging"}
I'm not sure if this implicit behavior would be more confusing than it is convenient. Should from logging import Logger work too? How would I differentiate that from an imported function? I could simply say that I rely on type checkers to check the correctness...
Consider the following example
Currently, referencing
logging.Loggerfor the attribute will be reported as an "unknown name" and is replaced withfrom typing import Any as logging_Logger. Insteadimport loggingcould be treated as a module-scopedI'm not sure if this implicit behavior would be more confusing than it is convenient. Should
from logging import Loggerwork too? How would I differentiate that from an imported function? I could simply say that I rely on type checkers to check the correctness...