-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
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...
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request