mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
argparse: Use SupportsWrite instead of IO (#13324)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import sentinel
|
||||
from _typeshed import SupportsWrite, sentinel
|
||||
from collections.abc import Callable, Generator, Iterable, Sequence
|
||||
from re import Pattern
|
||||
from typing import IO, Any, ClassVar, Final, Generic, NewType, NoReturn, Protocol, TypeVar, overload
|
||||
@@ -207,8 +207,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
help: str | None = None,
|
||||
metavar: str | None = None,
|
||||
) -> _SubParsersAction[_ArgumentParserT]: ...
|
||||
def print_usage(self, file: IO[str] | None = None) -> None: ...
|
||||
def print_help(self, file: IO[str] | None = None) -> None: ...
|
||||
def print_usage(self, file: SupportsWrite[str] | None = None) -> None: ...
|
||||
def print_help(self, file: SupportsWrite[str] | None = None) -> None: ...
|
||||
def format_usage(self) -> str: ...
|
||||
def format_help(self) -> str: ...
|
||||
@overload
|
||||
@@ -254,7 +254,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
def _get_value(self, action: Action, arg_string: str) -> Any: ...
|
||||
def _check_value(self, action: Action, value: Any) -> None: ...
|
||||
def _get_formatter(self) -> HelpFormatter: ...
|
||||
def _print_message(self, message: str, file: IO[str] | None = None) -> None: ...
|
||||
def _print_message(self, message: str, file: SupportsWrite[str] | None = None) -> None: ...
|
||||
|
||||
class HelpFormatter:
|
||||
# undocumented
|
||||
|
||||
Reference in New Issue
Block a user