mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
fix type of FileIO.__init__ opener kwarg (#5738)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import builtins
|
||||
import codecs
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, Self, WriteableBuffer
|
||||
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
|
||||
from os import _Opener
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, List, Optional, TextIO, Tuple, Type, Union
|
||||
|
||||
@@ -64,14 +65,9 @@ class BufferedIOBase(IOBase):
|
||||
|
||||
class FileIO(RawIOBase, BinaryIO):
|
||||
mode: str
|
||||
# Technically this is whatever is passed in as file, either a str, a bytes, or an int.
|
||||
name: Union[int, str] # type: ignore
|
||||
name: StrOrBytesPath | int # type: ignore
|
||||
def __init__(
|
||||
self,
|
||||
file: Union[str, bytes, int],
|
||||
mode: str = ...,
|
||||
closefd: bool = ...,
|
||||
opener: Optional[Callable[[Union[int, str], str], int]] = ...,
|
||||
self, file: StrOrBytesPath | int, mode: str = ..., closefd: bool = ..., opener: _Opener | None = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def closefd(self) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user