mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 02:15:58 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user