Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -1,10 +1,10 @@
from codecs import CodecInfo
from typing import Any, Optional, Union
from typing import Any
class CodecRegistryError(LookupError, SystemError): ...
def normalize_encoding(encoding: Union[str, bytes]) -> str: ...
def search_function(encoding: str) -> Optional[CodecInfo]: ...
def normalize_encoding(encoding: str | bytes) -> str: ...
def search_function(encoding: str) -> CodecInfo | None: ...
# Needed for submodules
def __getattr__(name: str) -> Any: ... # incomplete

View File

@@ -1,21 +1,21 @@
import codecs
from typing import Optional, Tuple
from typing import Tuple
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = ...) -> bytes: ...
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
@staticmethod
def _buffer_decode(__data: bytes, __errors: Optional[str] = ..., __final: bool = ...) -> Tuple[str, int]: ...
def _buffer_decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> Tuple[str, int]: ...
class StreamWriter(codecs.StreamWriter):
@staticmethod
def encode(__str: str, __errors: Optional[str] = ...) -> Tuple[bytes, int]: ...
def encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
class StreamReader(codecs.StreamReader):
@staticmethod
def decode(__data: bytes, __errors: Optional[str] = ..., __final: bool = ...) -> Tuple[str, int]: ...
def decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> Tuple[str, int]: ...
def getregentry() -> codecs.CodecInfo: ...
def encode(__str: str, __errors: Optional[str] = ...) -> Tuple[bytes, int]: ...
def decode(input: bytes, errors: Optional[str] = ...) -> Tuple[str, int]: ...
def encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def decode(input: bytes, errors: str | None = ...) -> Tuple[str, int]: ...