Replace a few instances of IO with protocols (#4296)

This commit is contained in:
Sebastian Rittau
2020-07-01 03:05:30 +02:00
committed by GitHub
parent 83e955b52f
commit b8f6d5fc54
3 changed files with 98 additions and 17 deletions

View File

@@ -1,7 +1,6 @@
import sys
from _typeshed import AnyPath, StrPath
from _typeshed import AnyPath, StrPath, SupportsWrite
from typing import (
IO,
AbstractSet,
Any,
Callable,
@@ -122,7 +121,7 @@ class RawConfigParser(_parser):
@overload
def items(self, section: str, raw: bool = ..., vars: Optional[_section] = ...) -> List[Tuple[str, str]]: ...
def set(self, section: str, option: str, value: Optional[str] = ...) -> None: ...
def write(self, fp: IO[str], space_around_delimiters: bool = ...) -> None: ...
def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = ...) -> None: ...
def remove_option(self, section: str, option: str) -> bool: ...
def remove_section(self, section: str) -> bool: ...
def optionxform(self, optionstr: str) -> str: ...