2 from _typeshed import StrOrBytesPath, StrPath
3 from collections.abc import Callable
4 from configparser import RawConfigParser
5 from threading import Thread
6 from typing import IO, Any, Pattern, Sequence
10 if sys.version_info >= (3, 8):
11 from typing import Literal, TypedDict
13 from typing_extensions import Literal, TypedDict
15 if sys.version_info >= (3, 7):
16 _Path = StrOrBytesPath
20 DEFAULT_LOGGING_CONFIG_PORT: int
21 RESET_ERROR: int # undocumented
22 IDENTIFIER: Pattern[str] # undocumented
24 class _RootLoggerConfiguration(TypedDict, total=False):
26 filters: Sequence[str]
27 handlers: Sequence[str]
29 class _LoggerConfiguration(_RootLoggerConfiguration, TypedDict, total=False):
32 class _OptionalDictConfigArgs(TypedDict, total=False):
33 # these two can have custom factories (key: `()`) which can have extra keys
34 formatters: dict[str, dict[str, Any]]
35 filters: dict[str, dict[str, Any]]
36 # type checkers would warn about extra keys if this was a TypedDict
37 handlers: dict[str, dict[str, Any]]
38 loggers: dict[str, _LoggerConfiguration]
39 root: _RootLoggerConfiguration | None
41 disable_existing_loggers: bool
43 class _DictConfigArgs(_OptionalDictConfigArgs, TypedDict):
46 def dictConfig(config: _DictConfigArgs) -> None: ...
48 if sys.version_info >= (3, 10):
50 fname: _Path | IO[str] | RawConfigParser,
51 defaults: dict[str, str] | None = ...,
52 disable_existing_loggers: bool = ...,
53 encoding: str | None = ...,
58 fname: _Path | IO[str] | RawConfigParser, defaults: dict[str, str] | None = ..., disable_existing_loggers: bool = ...
61 def valid_ident(s: str) -> Literal[True]: ... # undocumented
62 def listen(port: int = ..., verify: Callable[[bytes], bytes | None] | None = ...) -> Thread: ...
63 def stopListening() -> None: ...