Skip to content

Commit 2f0434f

Browse files
committed
Typeshed cherry-pick: Relax signature of logging.config.loadConfig (#6577)
1 parent 9898ea4 commit 2f0434f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mypy/typeshed/stdlib/logging/config.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ class _OptionalDictConfigArgs(TypedDict, total=False):
4343
class _DictConfigArgs(_OptionalDictConfigArgs, TypedDict):
4444
version: Literal[1]
4545

46-
def dictConfig(config: _DictConfigArgs) -> None: ...
46+
# Accept dict[str, Any] to avoid false positives if called with a dict
47+
# type, since dict types are not compatible with TypedDicts.
48+
#
49+
# Also accept a TypedDict type, to allow callers to use TypedDict
50+
# types, and for somewhat stricter type checking of dict literals.
51+
def dictConfig(config: _DictConfigArgs | dict[str, Any]) -> None: ...
4752

4853
if sys.version_info >= (3, 10):
4954
def fileConfig(

0 commit comments

Comments
 (0)