Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -20,7 +20,7 @@ raiseExceptions: bool
logThreads: bool
logMultiprocessing: bool
logProcesses: bool
_srcfile: Optional[str]
_srcfile: str | None
def currentframe() -> FrameType: ...
@@ -38,9 +38,9 @@ class Manager(object): # undocumented
root: RootLogger
disable: int
emittedNoHandlerWarning: bool
loggerDict: dict[str, Union[Logger, PlaceHolder]]
loggerClass: Optional[Type[Logger]]
logRecordFactory: Optional[Callable[..., LogRecord]]
loggerDict: dict[str, Logger | PlaceHolder]
loggerClass: Type[Logger] | None
logRecordFactory: Callable[..., LogRecord] | None
def __init__(self, rootnode: RootLogger) -> None: ...
def getLogger(self, name: str) -> Logger: ...
def setLoggerClass(self, klass: Type[Logger]) -> None: ...
@@ -49,7 +49,7 @@ class Manager(object): # undocumented
class Logger(Filterer):
name: str # undocumented
level: int # undocumented
parent: Optional[Logger] # undocumented
parent: Logger | None # undocumented
propagate: bool
handlers: list[Handler] # undocumented
disabled: bool # undocumented
@@ -68,7 +68,7 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def info(
self,
@@ -77,7 +77,7 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def warning(
self,
@@ -86,7 +86,7 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def warn(
self,
@@ -95,7 +95,7 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def error(
self,
@@ -104,7 +104,7 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def exception(
self,
@@ -113,7 +113,7 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def critical(
self,
@@ -122,7 +122,7 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def log(
self,
@@ -132,66 +132,36 @@ class Logger(Filterer):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def _log(
self,
level: int,
msg: Any,
args: _ArgsType,
exc_info: Optional[_ExcInfoType] = ...,
extra: Optional[dict[str, Any]] = ...,
exc_info: _ExcInfoType | None = ...,
extra: dict[str, Any] | None = ...,
stack_info: bool = ...,
stacklevel: int = ...,
) -> None: ... # undocumented
else:
def debug(
self,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def info(
self,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def warning(
self,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def warn(
self,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def error(
self,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def critical(
self,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def log(
self,
@@ -200,23 +170,18 @@ class Logger(Filterer):
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def exception(
self,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def _log(
self,
level: int,
msg: Any,
args: _ArgsType,
exc_info: Optional[_ExcInfoType] = ...,
extra: Optional[dict[str, Any]] = ...,
exc_info: _ExcInfoType | None = ...,
extra: dict[str, Any] | None = ...,
stack_info: bool = ...,
) -> None: ... # undocumented
fatal = critical
@@ -224,9 +189,9 @@ class Logger(Filterer):
def addHandler(self, hdlr: Handler) -> None: ...
def removeHandler(self, hdlr: Handler) -> None: ...
if sys.version_info >= (3, 8):
def findCaller(self, stack_info: bool = ..., stacklevel: int = ...) -> tuple[str, int, str, Optional[str]]: ...
def findCaller(self, stack_info: bool = ..., stacklevel: int = ...) -> tuple[str, int, str, str | None]: ...
else:
def findCaller(self, stack_info: bool = ...) -> tuple[str, int, str, Optional[str]]: ...
def findCaller(self, stack_info: bool = ...) -> tuple[str, int, str, str | None]: ...
def handle(self, record: LogRecord) -> None: ...
def makeRecord(
self,
@@ -236,10 +201,10 @@ class Logger(Filterer):
lno: int,
msg: Any,
args: _ArgsType,
exc_info: Optional[_SysExcInfoType],
func: Optional[str] = ...,
extra: Optional[Mapping[str, Any]] = ...,
sinfo: Optional[str] = ...,
exc_info: _SysExcInfoType | None,
func: str | None = ...,
extra: Mapping[str, Any] | None = ...,
sinfo: str | None = ...,
) -> LogRecord: ...
def hasHandlers(self) -> bool: ...
def callHandlers(self, record: LogRecord) -> None: ... # undocumented
@@ -255,9 +220,9 @@ NOTSET: int
class Handler(Filterer):
level: int # undocumented
formatter: Optional[Formatter] # undocumented
lock: Optional[threading.Lock] # undocumented
name: Optional[str] # undocumented
formatter: Formatter | None # undocumented
lock: threading.Lock | None # undocumented
name: str | None # undocumented
def __init__(self, level: _Level = ...) -> None: ...
def get_name(self) -> str: ... # undocumented
def set_name(self, name: str) -> None: ... # undocumented
@@ -265,7 +230,7 @@ class Handler(Filterer):
def acquire(self) -> None: ...
def release(self) -> None: ...
def setLevel(self, level: _Level) -> None: ...
def setFormatter(self, fmt: Optional[Formatter]) -> None: ...
def setFormatter(self, fmt: Formatter | None) -> None: ...
def filter(self, record: LogRecord) -> bool: ...
def flush(self) -> None: ...
def close(self) -> None: ...
@@ -275,24 +240,24 @@ class Handler(Filterer):
def emit(self, record: LogRecord) -> None: ...
class Formatter:
converter: Callable[[Optional[float]], struct_time]
_fmt: Optional[str] # undocumented
datefmt: Optional[str] # undocumented
converter: Callable[[float | None], struct_time]
_fmt: str | None # undocumented
datefmt: str | None # undocumented
_style: PercentStyle # undocumented
default_time_format: str
if sys.version_info >= (3, 9):
default_msec_format: Optional[str]
default_msec_format: str | None
else:
default_msec_format: str
if sys.version_info >= (3, 8):
def __init__(
self, fmt: Optional[str] = ..., datefmt: Optional[str] = ..., style: _FormatStyle = ..., validate: bool = ...
self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ..., validate: bool = ...
) -> None: ...
else:
def __init__(self, fmt: Optional[str] = ..., datefmt: Optional[str] = ..., style: _FormatStyle = ...) -> None: ...
def __init__(self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ...) -> None: ...
def format(self, record: LogRecord) -> str: ...
def formatTime(self, record: LogRecord, datefmt: Optional[str] = ...) -> str: ...
def formatTime(self, record: LogRecord, datefmt: str | None = ...) -> str: ...
def formatException(self, ei: _SysExcInfoType) -> str: ...
def formatMessage(self, record: LogRecord) -> str: ... # undocumented
def formatStack(self, stack_info: str) -> str: ...
@@ -300,7 +265,7 @@ class Formatter:
class BufferingFormatter:
linefmt: Formatter
def __init__(self, linefmt: Optional[Formatter] = ...) -> None: ...
def __init__(self, linefmt: Formatter | None = ...) -> None: ...
def formatHeader(self, records: Sequence[LogRecord]) -> str: ...
def formatFooter(self, records: Sequence[LogRecord]) -> str: ...
def format(self, records: Sequence[LogRecord]) -> str: ...
@@ -317,8 +282,8 @@ class LogRecord:
args: _ArgsType | None
asctime: str
created: float
exc_info: Optional[_SysExcInfoType]
exc_text: Optional[str]
exc_info: _SysExcInfoType | None
exc_text: str | None
filename: str
funcName: str
levelname: str
@@ -330,12 +295,12 @@ class LogRecord:
msg: str
name: str
pathname: str
process: Optional[int]
processName: Optional[str]
process: int | None
processName: str | None
relativeCreated: float
stack_info: Optional[str]
thread: Optional[int]
threadName: Optional[str]
stack_info: str | None
thread: int | None
threadName: str | None
def __init__(
self,
name: str,
@@ -344,9 +309,9 @@ class LogRecord:
lineno: int,
msg: Any,
args: _ArgsType | None,
exc_info: Optional[_SysExcInfoType],
func: Optional[str] = ...,
sinfo: Optional[str] = ...,
exc_info: _SysExcInfoType | None,
func: str | None = ...,
sinfo: str | None = ...,
) -> None: ...
def getMessage(self) -> str: ...
@@ -354,8 +319,8 @@ class LoggerAdapter:
logger: Logger | LoggerAdapter
manager: Manager # undocumented
if sys.version_info >= (3, 10):
extra: Optional[Mapping[str, Any]]
def __init__(self, logger: Logger | LoggerAdapter, extra: Optional[Mapping[str, Any]]) -> None: ...
extra: Mapping[str, Any] | None
def __init__(self, logger: Logger | LoggerAdapter, extra: Mapping[str, Any] | None) -> None: ...
else:
extra: Mapping[str, Any]
def __init__(self, logger: Logger | LoggerAdapter, extra: Mapping[str, Any]) -> None: ...
@@ -368,7 +333,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def info(
@@ -378,7 +343,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def warning(
@@ -388,7 +353,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def warn(
@@ -398,7 +363,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def error(
@@ -408,7 +373,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def exception(
@@ -418,7 +383,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def critical(
@@ -428,7 +393,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def log(
@@ -439,7 +404,7 @@ class LoggerAdapter:
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
else:
@@ -449,7 +414,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def info(
@@ -458,7 +423,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def warning(
@@ -467,7 +432,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def warn(
@@ -476,7 +441,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def error(
@@ -485,7 +450,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def exception(
@@ -494,7 +459,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def critical(
@@ -503,7 +468,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def log(
@@ -513,7 +478,7 @@ class LoggerAdapter:
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
**kwargs: Any,
) -> None: ...
def isEnabledFor(self, level: int) -> bool: ...
@@ -525,14 +490,14 @@ class LoggerAdapter:
level: int,
msg: Any,
args: _ArgsType,
exc_info: Optional[_ExcInfoType] = ...,
extra: Optional[dict[str, Any]] = ...,
exc_info: _ExcInfoType | None = ...,
extra: dict[str, Any] | None = ...,
stack_info: bool = ...,
) -> None: ... # undocumented
@property
def name(self) -> str: ... # undocumented
def getLogger(name: Optional[str] = ...) -> Logger: ...
def getLogger(name: str | None = ...) -> Logger: ...
def getLoggerClass() -> Type[Logger]: ...
def getLogRecordFactory() -> Callable[..., LogRecord]: ...
@@ -543,7 +508,7 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def info(
msg: Any,
@@ -551,7 +516,7 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def warning(
msg: Any,
@@ -559,7 +524,7 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def warn(
msg: Any,
@@ -567,7 +532,7 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def error(
msg: Any,
@@ -575,7 +540,7 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def critical(
msg: Any,
@@ -583,7 +548,7 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def exception(
msg: Any,
@@ -591,7 +556,7 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
def log(
level: int,
@@ -600,38 +565,33 @@ if sys.version_info >= (3, 8):
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
stacklevel: int = ...,
extra: Optional[dict[str, Any]] = ...,
extra: dict[str, Any] | None = ...,
) -> None: ...
else:
def debug(
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Optional[dict[str, Any]] = ...
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def info(
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Optional[dict[str, Any]] = ...
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def warning(
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Optional[dict[str, Any]] = ...
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def warn(
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Optional[dict[str, Any]] = ...
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def error(
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Optional[dict[str, Any]] = ...
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def critical(
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Optional[dict[str, Any]] = ...
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def exception(
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Optional[dict[str, Any]] = ...
msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
def log(
level: int,
msg: Any,
*args: Any,
exc_info: _ExcInfoType = ...,
stack_info: bool = ...,
extra: Optional[dict[str, Any]] = ...,
level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: dict[str, Any] | None = ...
) -> None: ...
fatal = critical
@@ -649,44 +609,44 @@ def makeLogRecord(dict: Mapping[str, Any]) -> LogRecord: ...
if sys.version_info >= (3, 9):
def basicConfig(
*,
filename: Optional[StrPath] = ...,
filename: StrPath | None = ...,
filemode: str = ...,
format: str = ...,
datefmt: Optional[str] = ...,
datefmt: str | None = ...,
style: _FormatStyle = ...,
level: Optional[_Level] = ...,
stream: Optional[SupportsWrite[str]] = ...,
handlers: Optional[Iterable[Handler]] = ...,
force: Optional[bool] = ...,
encoding: Optional[str] = ...,
errors: Optional[str] = ...,
level: _Level | None = ...,
stream: SupportsWrite[str] | None = ...,
handlers: Iterable[Handler] | None = ...,
force: bool | None = ...,
encoding: str | None = ...,
errors: str | None = ...,
) -> None: ...
elif sys.version_info >= (3, 8):
def basicConfig(
*,
filename: Optional[StrPath] = ...,
filename: StrPath | None = ...,
filemode: str = ...,
format: str = ...,
datefmt: Optional[str] = ...,
datefmt: str | None = ...,
style: _FormatStyle = ...,
level: Optional[_Level] = ...,
stream: Optional[SupportsWrite[str]] = ...,
handlers: Optional[Iterable[Handler]] = ...,
level: _Level | None = ...,
stream: SupportsWrite[str] | None = ...,
handlers: Iterable[Handler] | None = ...,
force: bool = ...,
) -> None: ...
else:
def basicConfig(
*,
filename: Optional[StrPath] = ...,
filename: StrPath | None = ...,
filemode: str = ...,
format: str = ...,
datefmt: Optional[str] = ...,
datefmt: str | None = ...,
style: _FormatStyle = ...,
level: Optional[_Level] = ...,
stream: Optional[SupportsWrite[str]] = ...,
handlers: Optional[Iterable[Handler]] = ...,
level: _Level | None = ...,
stream: SupportsWrite[str] | None = ...,
handlers: Iterable[Handler] | None = ...,
) -> None: ...
def shutdown(handlerList: Sequence[Any] = ...) -> None: ... # handlerList is undocumented

View File

@@ -3,7 +3,7 @@ from _typeshed import StrOrBytesPath, StrPath
from collections.abc import Callable
from configparser import RawConfigParser
from threading import Thread
from typing import IO, Any, Optional, Pattern, Union
from typing import IO, Any, Pattern
if sys.version_info >= (3, 8):
from typing import Literal
@@ -23,19 +23,17 @@ def dictConfig(config: dict[str, Any]) -> None: ...
if sys.version_info >= (3, 10):
def fileConfig(
fname: Union[_Path, IO[str], RawConfigParser],
defaults: Optional[dict[str, str]] = ...,
fname: _Path | IO[str] | RawConfigParser,
defaults: dict[str, str] | None = ...,
disable_existing_loggers: bool = ...,
encoding: Optional[str] = ...,
encoding: str | None = ...,
) -> None: ...
else:
def fileConfig(
fname: Union[_Path, IO[str], RawConfigParser],
defaults: Optional[dict[str, str]] = ...,
disable_existing_loggers: bool = ...,
fname: _Path | IO[str] | RawConfigParser, defaults: dict[str, str] | None = ..., disable_existing_loggers: bool = ...
) -> None: ...
def valid_ident(s: str) -> Literal[True]: ... # undocumented
def listen(port: int = ..., verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ...
def listen(port: int = ..., verify: Callable[[bytes], bytes | None] | None = ...) -> Thread: ...
def stopListening() -> None: ...

View File

@@ -6,7 +6,7 @@ from _typeshed import StrPath
from collections.abc import Callable
from logging import FileHandler, Handler, LogRecord
from socket import SocketKind, socket
from typing import Any, ClassVar, Optional, Pattern, Union
from typing import Any, ClassVar, Pattern
if sys.version_info >= (3, 7):
from queue import Queue, SimpleQueue
@@ -25,27 +25,22 @@ class WatchedFileHandler(FileHandler):
ino: int # undocumented
if sys.version_info >= (3, 9):
def __init__(
self,
filename: StrPath,
mode: str = ...,
encoding: Optional[str] = ...,
delay: bool = ...,
errors: Optional[str] = ...,
self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ..., errors: str | None = ...
) -> None: ...
else:
def __init__(self, filename: StrPath, mode: str = ..., encoding: Optional[str] = ..., delay: bool = ...) -> None: ...
def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ...
def _statstream(self) -> None: ... # undocumented
def reopenIfNeeded(self) -> None: ...
class BaseRotatingHandler(FileHandler):
namer: Optional[Callable[[str], str]]
rotator: Optional[Callable[[str, str], None]]
namer: Callable[[str], str] | None
rotator: Callable[[str, str], None] | None
if sys.version_info >= (3, 9):
def __init__(
self, filename: StrPath, mode: str, encoding: Optional[str] = ..., delay: bool = ..., errors: Optional[str] = ...
self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ..., errors: str | None = ...
) -> None: ...
else:
def __init__(self, filename: StrPath, mode: str, encoding: Optional[str] = ..., delay: bool = ...) -> None: ...
def __init__(self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ...) -> None: ...
def rotation_filename(self, default_name: str) -> str: ...
def rotate(self, source: str, dest: str) -> None: ...
@@ -59,9 +54,9 @@ class RotatingFileHandler(BaseRotatingHandler):
mode: str = ...,
maxBytes: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
encoding: str | None = ...,
delay: bool = ...,
errors: Optional[str] = ...,
errors: str | None = ...,
) -> None: ...
else:
def __init__(
@@ -70,7 +65,7 @@ class RotatingFileHandler(BaseRotatingHandler):
mode: str = ...,
maxBytes: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
encoding: str | None = ...,
delay: bool = ...,
) -> None: ...
def doRollover(self) -> None: ...
@@ -80,7 +75,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
when: str # undocumented
backupCount: str # undocumented
utc: bool # undocumented
atTime: Optional[datetime.datetime] # undocumented
atTime: datetime.datetime | None # undocumented
interval: int # undocumented
suffix: str # undocumented
dayOfWeek: int # undocumented
@@ -93,11 +88,11 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
when: str = ...,
interval: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
encoding: str | None = ...,
delay: bool = ...,
utc: bool = ...,
atTime: Optional[datetime.datetime] = ...,
errors: Optional[str] = ...,
atTime: datetime.datetime | None = ...,
errors: str | None = ...,
) -> None: ...
else:
def __init__(
@@ -106,10 +101,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
when: str = ...,
interval: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
encoding: str | None = ...,
delay: bool = ...,
utc: bool = ...,
atTime: Optional[datetime.datetime] = ...,
atTime: datetime.datetime | None = ...,
) -> None: ...
def doRollover(self) -> None: ...
def shouldRollover(self, record: LogRecord) -> int: ... # undocumented
@@ -118,15 +113,15 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
class SocketHandler(Handler):
host: str # undocumented
port: Optional[int] # undocumented
address: Union[tuple[str, int], str] # undocumented
sock: Optional[socket] # undocumented
port: int | None # undocumented
address: tuple[str, int] | str # undocumented
sock: socket | None # undocumented
closeOnError: bool # undocumented
retryTime: Optional[float] # undocumented
retryTime: float | None # undocumented
retryStart: float # undocumented
retryFactor: float # undocumented
retryMax: float # undocumented
def __init__(self, host: str, port: Optional[int]) -> None: ...
def __init__(self, host: str, port: int | None) -> None: ...
def makeSocket(self, timeout: float = ...) -> socket: ... # timeout is undocumented
def makePickle(self, record: LogRecord) -> bytes: ...
def send(self, s: bytes) -> None: ...
@@ -180,14 +175,12 @@ class SysLogHandler(Handler):
priority_names: ClassVar[dict[str, int]] # undocumented
facility_names: ClassVar[dict[str, int]] # undocumented
priority_map: ClassVar[dict[str, str]] # undocumented
def __init__(
self, address: Union[tuple[str, int], str] = ..., facility: int = ..., socktype: Optional[SocketKind] = ...
) -> None: ...
def encodePriority(self, facility: Union[int, str], priority: Union[int, str]) -> int: ...
def __init__(self, address: tuple[str, int] | str = ..., facility: int = ..., socktype: SocketKind | None = ...) -> None: ...
def encodePriority(self, facility: int | str, priority: int | str) -> int: ...
def mapPriority(self, levelName: str) -> str: ...
class NTEventLogHandler(Handler):
def __init__(self, appname: str, dllname: Optional[str] = ..., logtype: str = ...) -> None: ...
def __init__(self, appname: str, dllname: str | None = ..., logtype: str = ...) -> None: ...
def getEventCategory(self, record: LogRecord) -> int: ...
# TODO correct return value?
def getEventType(self, record: LogRecord) -> int: ...
@@ -195,23 +188,23 @@ class NTEventLogHandler(Handler):
class SMTPHandler(Handler):
mailhost: str # undocumented
mailport: Optional[int] # undocumented
username: Optional[str] # undocumented
mailport: int | None # undocumented
username: str | None # undocumented
# password only exists as an attribute if passed credentials is a tuple or list
password: str # undocumented
fromaddr: str # undocumented
toaddrs: list[str] # undocumented
subject: str # undocumented
secure: Union[tuple[()], tuple[str], tuple[str, str], None] # undocumented
secure: tuple[()] | tuple[str] | tuple[str, str] | None # undocumented
timeout: float # undocumented
def __init__(
self,
mailhost: Union[str, tuple[str, int]],
mailhost: str | tuple[str, int],
fromaddr: str,
toaddrs: Union[str, list[str]],
toaddrs: str | list[str],
subject: str,
credentials: Optional[tuple[str, str]] = ...,
secure: Union[tuple[()], tuple[str], tuple[str, str], None] = ...,
credentials: tuple[str, str] | None = ...,
secure: tuple[()] | tuple[str] | tuple[str, str] | None = ...,
timeout: float = ...,
) -> None: ...
def getSubject(self, record: LogRecord) -> str: ...
@@ -224,28 +217,26 @@ class BufferingHandler(Handler):
class MemoryHandler(BufferingHandler):
flushLevel: int # undocumented
target: Optional[Handler] # undocumented
target: Handler | None # undocumented
flushOnClose: bool # undocumented
def __init__(
self, capacity: int, flushLevel: int = ..., target: Optional[Handler] = ..., flushOnClose: bool = ...
) -> None: ...
def setTarget(self, target: Optional[Handler]) -> None: ...
def __init__(self, capacity: int, flushLevel: int = ..., target: Handler | None = ..., flushOnClose: bool = ...) -> None: ...
def setTarget(self, target: Handler | None) -> None: ...
class HTTPHandler(Handler):
host: str # undocumented
url: str # undocumented
method: str # undocumented
secure: bool # undocumented
credentials: Optional[tuple[str, str]] # undocumented
context: Optional[ssl.SSLContext] # undocumented
credentials: tuple[str, str] | None # undocumented
context: ssl.SSLContext | None # undocumented
def __init__(
self,
host: str,
url: str,
method: str = ...,
secure: bool = ...,
credentials: Optional[tuple[str, str]] = ...,
context: Optional[ssl.SSLContext] = ...,
credentials: tuple[str, str] | None = ...,
context: ssl.SSLContext | None = ...,
) -> None: ...
def mapLogRecord(self, record: LogRecord) -> dict[str, Any]: ...
if sys.version_info >= (3, 9):
@@ -253,8 +244,8 @@ class HTTPHandler(Handler):
class QueueHandler(Handler):
if sys.version_info >= (3, 7):
queue: Union[SimpleQueue[Any], Queue[Any]] # undocumented
def __init__(self, queue: Union[SimpleQueue[Any], Queue[Any]]) -> None: ...
queue: SimpleQueue[Any] | Queue[Any] # undocumented
def __init__(self, queue: SimpleQueue[Any] | Queue[Any]) -> None: ...
else:
queue: Queue[Any] # undocumented
def __init__(self, queue: Queue[Any]) -> None: ...
@@ -265,9 +256,9 @@ class QueueListener:
handlers: tuple[Handler] # undocumented
respect_handler_level: bool # undocumented
if sys.version_info >= (3, 7):
queue: Union[SimpleQueue[Any], Queue[Any]] # undocumented
queue: SimpleQueue[Any] | Queue[Any] # undocumented
def __init__(
self, queue: Union[SimpleQueue[Any], Queue[Any]], *handlers: Handler, respect_handler_level: bool = ...
self, queue: SimpleQueue[Any] | Queue[Any], *handlers: Handler, respect_handler_level: bool = ...
) -> None: ...
else:
queue: Queue[Any] # undocumented