move OpenTextMode and friends to _typeshed (#4213)

This commit is contained in:
Jelle Zijlstra
2020-06-10 06:36:21 -07:00
committed by GitHub
parent 85281b636e
commit ea577cec1f
7 changed files with 50 additions and 92 deletions

View File

@@ -1,4 +1,4 @@
from io import _OpenBinaryMode, _OpenTextMode
from _typeshed import OpenBinaryMode, OpenTextMode
from typing import (Any, BinaryIO, Generator, IO, List, Optional, Sequence,
TextIO, Tuple, Type, TypeVar, Union, overload)
from types import TracebackType
@@ -100,10 +100,10 @@ class Path(PurePath):
def mkdir(self, mode: int = ..., parents: bool = ...,
exist_ok: bool = ...) -> None: ...
@overload
def open(self, mode: _OpenTextMode = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...,
def open(self, mode: OpenTextMode = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...,
newline: Optional[str] = ...) -> TextIO: ...
@overload
def open(self, mode: _OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ...,
def open(self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ...,
newline: None = ...) -> BinaryIO: ...
@overload
def open(self, mode: str, buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...,