Skip to content

Commit ce36fd4

Browse files
authored
argparse: Use SupportsWrite instead of IO (#13324)
1 parent 5a10be1 commit ce36fd4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/argparse.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import sentinel
2+
from _typeshed import SupportsWrite, sentinel
33
from collections.abc import Callable, Generator, Iterable, Sequence
44
from re import Pattern
55
from typing import IO, Any, ClassVar, Final, Generic, NewType, NoReturn, Protocol, TypeVar, overload
@@ -207,8 +207,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
207207
help: str | None = None,
208208
metavar: str | None = None,
209209
) -> _SubParsersAction[_ArgumentParserT]: ...
210-
def print_usage(self, file: IO[str] | None = None) -> None: ...
211-
def print_help(self, file: IO[str] | None = None) -> None: ...
210+
def print_usage(self, file: SupportsWrite[str] | None = None) -> None: ...
211+
def print_help(self, file: SupportsWrite[str] | None = None) -> None: ...
212212
def format_usage(self) -> str: ...
213213
def format_help(self) -> str: ...
214214
@overload
@@ -254,7 +254,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
254254
def _get_value(self, action: Action, arg_string: str) -> Any: ...
255255
def _check_value(self, action: Action, value: Any) -> None: ...
256256
def _get_formatter(self) -> HelpFormatter: ...
257-
def _print_message(self, message: str, file: IO[str] | None = None) -> None: ...
257+
def _print_message(self, message: str, file: SupportsWrite[str] | None = None) -> None: ...
258258

259259
class HelpFormatter:
260260
# undocumented

0 commit comments

Comments
 (0)