We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ebd609 commit 187aaacCopy full SHA for 187aaac
stdlib/2and3/shutil.pyi
@@ -7,7 +7,7 @@ import sys
7
8
from typing import (
9
List, Iterable, Callable, Any, Tuple, Sequence, NamedTuple, IO,
10
- AnyStr, Optional, Union, Set, TypeVar, overload, Type
+ AnyStr, Optional, Union, Set, TypeVar, overload, Type, Protocol
11
)
12
13
if sys.version_info >= (3, 6):
@@ -40,7 +40,16 @@ else:
40
class SpecialFileError(EnvironmentError): ...
41
class ExecError(EnvironmentError): ...
42
43
-def copyfileobj(fsrc: IO[AnyStr], fdst: IO[AnyStr],
+_S_co = TypeVar("_S_co", covariant=True)
44
+_S_contra = TypeVar("_S_contra", contravariant=True)
45
+
46
+class _Reader(Protocol[_S_co]):
47
+ def read(self, length: int) -> _S_co: ...
48
49
+class _Writer(Protocol[_S_contra]):
50
+ def write(self, data: _S_contra) -> Any: ...
51
52
+def copyfileobj(fsrc: _Reader[AnyStr], fdst: _Writer[AnyStr],
53
length: int = ...) -> None: ...
54
55
if sys.version_info >= (3,):
0 commit comments