mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -29,7 +29,7 @@ __all__ = [
|
||||
|
||||
_PT: TypeAlias = tuple[str, int, str, str | None]
|
||||
|
||||
def print_tb(tb: TracebackType | None, limit: int | None = ..., file: SupportsWrite[str] | None = ...) -> None: ...
|
||||
def print_tb(tb: TracebackType | None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
@overload
|
||||
@@ -73,15 +73,15 @@ else:
|
||||
chain: bool = ...,
|
||||
) -> list[str]: ...
|
||||
|
||||
def print_exc(limit: int | None = ..., file: SupportsWrite[str] | None = ..., chain: bool = ...) -> None: ...
|
||||
def print_last(limit: int | None = ..., file: SupportsWrite[str] | None = ..., chain: bool = ...) -> None: ...
|
||||
def print_stack(f: FrameType | None = ..., limit: int | None = ..., file: SupportsWrite[str] | None = ...) -> None: ...
|
||||
def extract_tb(tb: TracebackType | None, limit: int | None = ...) -> StackSummary: ...
|
||||
def extract_stack(f: FrameType | None = ..., limit: int | None = ...) -> StackSummary: ...
|
||||
def print_exc(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ...
|
||||
def print_last(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ...
|
||||
def print_stack(f: FrameType | None = None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ...
|
||||
def extract_tb(tb: TracebackType | None, limit: int | None = None) -> StackSummary: ...
|
||||
def extract_stack(f: FrameType | None = None, limit: int | None = None) -> StackSummary: ...
|
||||
def format_list(extracted_list: list[FrameSummary]) -> list[str]: ...
|
||||
|
||||
# undocumented
|
||||
def print_list(extracted_list: list[FrameSummary], file: SupportsWrite[str] | None = ...) -> None: ...
|
||||
def print_list(extracted_list: list[FrameSummary], file: SupportsWrite[str] | None = None) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def format_exception_only(__exc: type[BaseException] | None, value: BaseException | None = ...) -> list[str]: ...
|
||||
@@ -89,9 +89,9 @@ if sys.version_info >= (3, 10):
|
||||
else:
|
||||
def format_exception_only(etype: type[BaseException] | None, value: BaseException | None) -> list[str]: ...
|
||||
|
||||
def format_exc(limit: int | None = ..., chain: bool = ...) -> str: ...
|
||||
def format_tb(tb: TracebackType | None, limit: int | None = ...) -> list[str]: ...
|
||||
def format_stack(f: FrameType | None = ..., limit: int | None = ...) -> list[str]: ...
|
||||
def format_exc(limit: int | None = None, chain: bool = True) -> str: ...
|
||||
def format_tb(tb: TracebackType | None, limit: int | None = None) -> list[str]: ...
|
||||
def format_stack(f: FrameType | None = None, limit: int | None = None) -> list[str]: ...
|
||||
def clear_frames(tb: TracebackType | None) -> None: ...
|
||||
def walk_stack(f: FrameType | None) -> Iterator[tuple[FrameType, int]]: ...
|
||||
def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ...
|
||||
@@ -99,7 +99,7 @@ def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
class _ExceptionPrintContext:
|
||||
def indent(self) -> str: ...
|
||||
def emit(self, text_gen: str | Iterable[str], margin_char: str | None = ...) -> Generator[str, None, None]: ...
|
||||
def emit(self, text_gen: str | Iterable[str], margin_char: str | None = None) -> Generator[str, None, None]: ...
|
||||
|
||||
class TracebackException:
|
||||
__cause__: TracebackException
|
||||
@@ -119,13 +119,13 @@ class TracebackException:
|
||||
exc_value: BaseException,
|
||||
exc_traceback: TracebackType | None,
|
||||
*,
|
||||
limit: int | None = ...,
|
||||
lookup_lines: bool = ...,
|
||||
capture_locals: bool = ...,
|
||||
compact: bool = ...,
|
||||
max_group_width: int = ...,
|
||||
max_group_depth: int = ...,
|
||||
_seen: set[int] | None = ...,
|
||||
limit: int | None = None,
|
||||
lookup_lines: bool = True,
|
||||
capture_locals: bool = False,
|
||||
compact: bool = False,
|
||||
max_group_width: int = 15,
|
||||
max_group_depth: int = 10,
|
||||
_seen: set[int] | None = None,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def from_exception(
|
||||
@@ -181,14 +181,14 @@ class TracebackException:
|
||||
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def format(self, *, chain: bool = ..., _ctx: _ExceptionPrintContext | None = ...) -> Generator[str, None, None]: ...
|
||||
def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str, None, None]: ...
|
||||
else:
|
||||
def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ...
|
||||
|
||||
def format_exception_only(self) -> Generator[str, None, None]: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def print(self, *, file: SupportsWrite[str] | None = ..., chain: bool = ...) -> None: ...
|
||||
def print(self, *, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ...
|
||||
|
||||
class FrameSummary(Iterable[Any]):
|
||||
if sys.version_info >= (3, 11):
|
||||
@@ -198,12 +198,12 @@ class FrameSummary(Iterable[Any]):
|
||||
lineno: int | None,
|
||||
name: str,
|
||||
*,
|
||||
lookup_line: bool = ...,
|
||||
locals: Mapping[str, str] | None = ...,
|
||||
line: str | None = ...,
|
||||
end_lineno: int | None = ...,
|
||||
colno: int | None = ...,
|
||||
end_colno: int | None = ...,
|
||||
lookup_line: bool = True,
|
||||
locals: Mapping[str, str] | None = None,
|
||||
line: str | None = None,
|
||||
end_lineno: int | None = None,
|
||||
colno: int | None = None,
|
||||
end_colno: int | None = None,
|
||||
) -> None: ...
|
||||
end_lineno: int | None
|
||||
colno: int | None
|
||||
@@ -246,9 +246,9 @@ class StackSummary(list[FrameSummary]):
|
||||
cls,
|
||||
frame_gen: Iterable[tuple[FrameType, int]],
|
||||
*,
|
||||
limit: int | None = ...,
|
||||
lookup_lines: bool = ...,
|
||||
capture_locals: bool = ...,
|
||||
limit: int | None = None,
|
||||
lookup_lines: bool = True,
|
||||
capture_locals: bool = False,
|
||||
) -> StackSummary: ...
|
||||
@classmethod
|
||||
def from_list(cls, a_list: Iterable[FrameSummary | _PT]) -> StackSummary: ...
|
||||
|
||||
Reference in New Issue
Block a user