mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-20 08:38:26 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -22,7 +22,7 @@ class WatchedFileHandler(FileHandler):
|
||||
ino: int # undocumented
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(
|
||||
self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ..., errors: str | None = ...
|
||||
self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ...
|
||||
@@ -35,7 +35,7 @@ class BaseRotatingHandler(FileHandler):
|
||||
rotator: Callable[[str, str], None] | None
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(
|
||||
self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ..., errors: str | None = ...
|
||||
self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False, errors: str | None = None
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ...) -> None: ...
|
||||
@@ -50,12 +50,12 @@ class RotatingFileHandler(BaseRotatingHandler):
|
||||
def __init__(
|
||||
self,
|
||||
filename: StrPath,
|
||||
mode: str = ...,
|
||||
maxBytes: int = ...,
|
||||
backupCount: int = ...,
|
||||
encoding: str | None = ...,
|
||||
delay: bool = ...,
|
||||
errors: str | None = ...,
|
||||
mode: str = "a",
|
||||
maxBytes: int = 0,
|
||||
backupCount: int = 0,
|
||||
encoding: str | None = None,
|
||||
delay: bool = False,
|
||||
errors: str | None = None,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
@@ -85,14 +85,14 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
||||
def __init__(
|
||||
self,
|
||||
filename: StrPath,
|
||||
when: str = ...,
|
||||
interval: int = ...,
|
||||
backupCount: int = ...,
|
||||
encoding: str | None = ...,
|
||||
delay: bool = ...,
|
||||
utc: bool = ...,
|
||||
atTime: datetime.time | None = ...,
|
||||
errors: str | None = ...,
|
||||
when: str = "h",
|
||||
interval: int = 1,
|
||||
backupCount: int = 0,
|
||||
encoding: str | None = None,
|
||||
delay: bool = False,
|
||||
utc: bool = False,
|
||||
atTime: datetime.time | None = None,
|
||||
errors: str | None = None,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
@@ -123,7 +123,7 @@ class SocketHandler(Handler):
|
||||
retryFactor: float # undocumented
|
||||
retryMax: float # undocumented
|
||||
def __init__(self, host: str, port: int | None) -> None: ...
|
||||
def makeSocket(self, timeout: float = ...) -> socket: ... # timeout is undocumented
|
||||
def makeSocket(self, timeout: float = 1) -> socket: ... # timeout is undocumented
|
||||
def makePickle(self, record: LogRecord) -> bytes: ...
|
||||
def send(self, s: ReadableBuffer) -> None: ...
|
||||
def createSocket(self) -> None: ...
|
||||
@@ -177,7 +177,7 @@ 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: tuple[str, int] | str = ..., facility: int = ..., socktype: SocketKind | None = ...) -> None: ...
|
||||
def __init__(self, address: tuple[str, int] | str = ..., facility: int = 1, socktype: SocketKind | None = None) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def createSocket(self) -> None: ...
|
||||
|
||||
@@ -185,7 +185,7 @@ class SysLogHandler(Handler):
|
||||
def mapPriority(self, levelName: str) -> str: ...
|
||||
|
||||
class NTEventLogHandler(Handler):
|
||||
def __init__(self, appname: str, dllname: str | None = ..., logtype: str = ...) -> None: ...
|
||||
def __init__(self, appname: str, dllname: str | None = None, logtype: str = "Application") -> None: ...
|
||||
def getEventCategory(self, record: LogRecord) -> int: ...
|
||||
# TODO correct return value?
|
||||
def getEventType(self, record: LogRecord) -> int: ...
|
||||
@@ -208,8 +208,8 @@ class SMTPHandler(Handler):
|
||||
fromaddr: str,
|
||||
toaddrs: str | list[str],
|
||||
subject: str,
|
||||
credentials: tuple[str, str] | None = ...,
|
||||
secure: tuple[()] | tuple[str] | tuple[str, str] | None = ...,
|
||||
credentials: tuple[str, str] | None = None,
|
||||
secure: tuple[()] | tuple[str] | tuple[str, str] | None = None,
|
||||
timeout: float = ...,
|
||||
) -> None: ...
|
||||
def getSubject(self, record: LogRecord) -> str: ...
|
||||
@@ -224,7 +224,7 @@ class MemoryHandler(BufferingHandler):
|
||||
flushLevel: int # undocumented
|
||||
target: Handler | None # undocumented
|
||||
flushOnClose: bool # undocumented
|
||||
def __init__(self, capacity: int, flushLevel: int = ..., target: Handler | None = ..., flushOnClose: bool = ...) -> None: ...
|
||||
def __init__(self, capacity: int, flushLevel: int = 40, target: Handler | None = None, flushOnClose: bool = True) -> None: ...
|
||||
def setTarget(self, target: Handler | None) -> None: ...
|
||||
|
||||
class HTTPHandler(Handler):
|
||||
@@ -238,10 +238,10 @@ class HTTPHandler(Handler):
|
||||
self,
|
||||
host: str,
|
||||
url: str,
|
||||
method: str = ...,
|
||||
secure: bool = ...,
|
||||
credentials: tuple[str, str] | None = ...,
|
||||
context: ssl.SSLContext | None = ...,
|
||||
method: str = "GET",
|
||||
secure: bool = False,
|
||||
credentials: tuple[str, str] | None = None,
|
||||
context: ssl.SSLContext | None = None,
|
||||
) -> None: ...
|
||||
def mapLogRecord(self, record: LogRecord) -> dict[str, Any]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -257,7 +257,7 @@ class QueueListener:
|
||||
handlers: tuple[Handler, ...] # undocumented
|
||||
respect_handler_level: bool # undocumented
|
||||
queue: SimpleQueue[Any] | Queue[Any] # undocumented
|
||||
def __init__(self, queue: SimpleQueue[Any] | Queue[Any], *handlers: Handler, respect_handler_level: bool = ...) -> None: ...
|
||||
def __init__(self, queue: SimpleQueue[Any] | Queue[Any], *handlers: Handler, respect_handler_level: bool = False) -> None: ...
|
||||
def dequeue(self, block: bool) -> LogRecord: ...
|
||||
def prepare(self, record: LogRecord) -> Any: ...
|
||||
def start(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user