Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,7 +1,7 @@
import asyncore
import socket
from abc import abstractmethod
from typing import Optional, Sequence, Tuple, Union
from typing import Sequence, Tuple
class simple_producer:
def __init__(self, data: bytes, buffer_size: int = ...) -> None: ...
@@ -10,13 +10,13 @@ class simple_producer:
class async_chat(asyncore.dispatcher):
ac_in_buffer_size: int
ac_out_buffer_size: int
def __init__(self, sock: Optional[socket.socket] = ..., map: Optional[asyncore._maptype] = ...) -> None: ...
def __init__(self, sock: socket.socket | None = ..., map: asyncore._maptype | None = ...) -> None: ...
@abstractmethod
def collect_incoming_data(self, data: bytes) -> None: ...
@abstractmethod
def found_terminator(self) -> None: ...
def set_terminator(self, term: Union[bytes, int, None]) -> None: ...
def get_terminator(self) -> Union[bytes, int, None]: ...
def set_terminator(self, term: bytes | int | None) -> None: ...
def get_terminator(self) -> bytes | int | None: ...
def handle_read(self) -> None: ...
def handle_write(self) -> None: ...
def handle_close(self) -> None: ...
@@ -29,9 +29,9 @@ class async_chat(asyncore.dispatcher):
def discard_buffers(self) -> None: ...
class fifo:
def __init__(self, list: Sequence[Union[bytes, simple_producer]] = ...) -> None: ...
def __init__(self, list: Sequence[bytes | simple_producer] = ...) -> None: ...
def __len__(self) -> int: ...
def is_empty(self) -> bool: ...
def first(self) -> bytes: ...
def push(self, data: Union[bytes, simple_producer]) -> None: ...
def push(self, data: bytes | simple_producer) -> None: ...
def pop(self) -> Tuple[int, bytes]: ...