mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-22 09:38:50 +08:00
Fix some errors with --disallow-any-generics (#3276)
See #3267. Covers all of stdlib/2and3.
This commit is contained in:
@@ -49,7 +49,7 @@ class _mmap(Generic[AnyStr]):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
class mmap(_mmap, ContextManager[mmap], Iterable[bytes], Sized):
|
||||
class mmap(_mmap[bytes], ContextManager[mmap], Iterable[bytes], Sized):
|
||||
closed: bool
|
||||
def rfind(self, sub: bytes, start: int = ..., stop: int = ...) -> int: ...
|
||||
@overload
|
||||
@@ -65,7 +65,7 @@ if sys.version_info >= (3,):
|
||||
# __len__, so we claim that there is also an __iter__ to help type checkers.
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
else:
|
||||
class mmap(_mmap, Sequence[bytes]):
|
||||
class mmap(_mmap[bytes], Sequence[bytes]):
|
||||
def rfind(self, string: bytes, start: int = ..., stop: int = ...) -> int: ...
|
||||
def __getitem__(self, index: Union[int, slice]) -> bytes: ...
|
||||
def __getslice__(self, i: Optional[int], j: Optional[int]) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user