mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
remove type ignores about python/mypy#5027 (#4119)
The mypy issue got fixed by the good people of mypy. I did have to add an override for __enter__ similar to what we're doing in #4082.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import io
|
||||
import sys
|
||||
from os.path import _PathType
|
||||
from typing import IO, Any, Mapping, Optional, Sequence, TextIO, Union, overload
|
||||
from typing import IO, Any, Mapping, Optional, Sequence, TextIO, TypeVar, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Literal
|
||||
@@ -14,6 +14,7 @@ _OpenTextWritingMode = Literal["wt", "xt", "at"]
|
||||
_PathOrFile = Union[_PathType, IO[bytes]]
|
||||
|
||||
_FilterChain = Sequence[Mapping[str, Any]]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
FORMAT_AUTO: int
|
||||
FORMAT_XZ: int
|
||||
@@ -69,7 +70,7 @@ class LZMACompressor(object):
|
||||
|
||||
class LZMAError(Exception): ...
|
||||
|
||||
class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027
|
||||
class LZMAFile(io.BufferedIOBase, IO[bytes]):
|
||||
def __init__(
|
||||
self,
|
||||
filename: Optional[_PathOrFile] = ...,
|
||||
@@ -80,6 +81,7 @@ class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#502
|
||||
preset: Optional[int] = ...,
|
||||
filters: Optional[_FilterChain] = ...,
|
||||
) -> None: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user