mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-25 01:38:40 +08:00
Replace Incomplete | None = None in third party stubs (#14063)
This commit is contained in:
@@ -21,9 +21,7 @@ class BaseConnection(Connection, metaclass=abc.ABCMeta):
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
@abc.abstractmethod
|
||||
def create_connection(
|
||||
cls, connection_configs, on_done, custom_ioloop: Incomplete | None = None, workflow: Incomplete | None = None
|
||||
): ...
|
||||
def create_connection(cls, connection_configs, on_done, custom_ioloop=None, workflow=None): ...
|
||||
@property
|
||||
def ioloop(self): ...
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from ..spec import BasicProperties
|
||||
LOGGER: Logger
|
||||
|
||||
class _CallbackResult:
|
||||
def __init__(self, value_class: Incomplete | None = None) -> None: ...
|
||||
def __init__(self, value_class=None) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
__nonzero__: Incomplete
|
||||
@@ -56,9 +56,7 @@ class BlockingConnection:
|
||||
class _OnChannelOpenedArgs(NamedTuple):
|
||||
channel: Incomplete
|
||||
|
||||
def __init__(
|
||||
self, parameters: Parameters | Sequence[Parameters] | None = None, _impl_class: Incomplete | None = None
|
||||
) -> None: ...
|
||||
def __init__(self, parameters: Parameters | Sequence[Parameters] | None = None, _impl_class=None) -> None: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
@@ -129,13 +127,7 @@ class _ConsumerInfo:
|
||||
on_message_callback: Incomplete
|
||||
alternate_event_sink: Incomplete
|
||||
state: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
consumer_tag,
|
||||
auto_ack,
|
||||
on_message_callback: Incomplete | None = None,
|
||||
alternate_event_sink: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, consumer_tag, auto_ack, on_message_callback=None, alternate_event_sink=None) -> None: ...
|
||||
@property
|
||||
def setting_up(self): ...
|
||||
@property
|
||||
@@ -188,24 +180,13 @@ class BlockingChannel:
|
||||
def add_on_cancel_callback(self, callback) -> None: ...
|
||||
def add_on_return_callback(self, callback): ...
|
||||
def basic_consume(
|
||||
self,
|
||||
queue,
|
||||
on_message_callback,
|
||||
auto_ack: bool = False,
|
||||
exclusive: bool = False,
|
||||
consumer_tag: Incomplete | None = None,
|
||||
arguments: Incomplete | None = None,
|
||||
self, queue, on_message_callback, auto_ack: bool = False, exclusive: bool = False, consumer_tag=None, arguments=None
|
||||
): ...
|
||||
def basic_cancel(self, consumer_tag): ...
|
||||
def start_consuming(self) -> None: ...
|
||||
def stop_consuming(self, consumer_tag: Incomplete | None = None) -> None: ...
|
||||
def stop_consuming(self, consumer_tag=None) -> None: ...
|
||||
def consume(
|
||||
self,
|
||||
queue,
|
||||
auto_ack: bool = False,
|
||||
exclusive: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
inactivity_timeout: Incomplete | None = None,
|
||||
self, queue, auto_ack: bool = False, exclusive: bool = False, arguments=None, inactivity_timeout=None
|
||||
) -> Generator[Incomplete, None, None]: ...
|
||||
def get_waiting_message_count(self): ...
|
||||
def cancel(self): ...
|
||||
@@ -235,14 +216,8 @@ class BlockingChannel:
|
||||
arguments: _ArgumentMapping | None = None,
|
||||
): ...
|
||||
def exchange_delete(self, exchange: str | None = None, if_unused: bool = False): ...
|
||||
def exchange_bind(self, destination, source, routing_key: str = "", arguments: Incomplete | None = None): ...
|
||||
def exchange_unbind(
|
||||
self,
|
||||
destination: Incomplete | None = None,
|
||||
source: Incomplete | None = None,
|
||||
routing_key: str = "",
|
||||
arguments: Incomplete | None = None,
|
||||
): ...
|
||||
def exchange_bind(self, destination, source, routing_key: str = "", arguments=None): ...
|
||||
def exchange_unbind(self, destination=None, source=None, routing_key: str = "", arguments=None): ...
|
||||
def queue_declare(
|
||||
self,
|
||||
queue,
|
||||
@@ -250,18 +225,12 @@ class BlockingChannel:
|
||||
durable: bool = False,
|
||||
exclusive: bool = False,
|
||||
auto_delete: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
arguments=None,
|
||||
): ...
|
||||
def queue_delete(self, queue, if_unused: bool = False, if_empty: bool = False): ...
|
||||
def queue_purge(self, queue): ...
|
||||
def queue_bind(self, queue, exchange, routing_key: Incomplete | None = None, arguments: Incomplete | None = None): ...
|
||||
def queue_unbind(
|
||||
self,
|
||||
queue,
|
||||
exchange: Incomplete | None = None,
|
||||
routing_key: Incomplete | None = None,
|
||||
arguments: Incomplete | None = None,
|
||||
): ...
|
||||
def queue_bind(self, queue, exchange, routing_key=None, arguments=None): ...
|
||||
def queue_unbind(self, queue, exchange=None, routing_key=None, arguments=None): ...
|
||||
def tx_select(self): ...
|
||||
def tx_commit(self): ...
|
||||
def tx_rollback(self): ...
|
||||
|
||||
@@ -12,17 +12,15 @@ SELECT_TYPE: Incomplete
|
||||
class SelectConnection(BaseConnection):
|
||||
def __init__(
|
||||
self,
|
||||
parameters: Incomplete | None = None,
|
||||
on_open_callback: Incomplete | None = None,
|
||||
on_open_error_callback: Incomplete | None = None,
|
||||
on_close_callback: Incomplete | None = None,
|
||||
custom_ioloop: Incomplete | None = None,
|
||||
parameters=None,
|
||||
on_open_callback=None,
|
||||
on_open_error_callback=None,
|
||||
on_close_callback=None,
|
||||
custom_ioloop=None,
|
||||
internal_connection_workflow: bool = True,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def create_connection(
|
||||
cls, connection_configs, on_done, custom_ioloop: Incomplete | None = None, workflow: Incomplete | None = None
|
||||
): ...
|
||||
def create_connection(cls, connection_configs, on_done, custom_ioloop=None, workflow=None): ...
|
||||
|
||||
class _Timeout:
|
||||
deadline: Incomplete
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import abc
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from pika.adapters.utils.nbio_interface import AbstractIOReference, AbstractStreamTransport
|
||||
|
||||
@@ -10,9 +9,7 @@ class SocketConnectionMixin:
|
||||
def connect_socket(self, sock, resolved_addr, on_done): ...
|
||||
|
||||
class StreamingConnectionMixin:
|
||||
def create_streaming_connection(
|
||||
self, protocol_factory, sock, on_done, ssl_context: Incomplete | None = None, server_hostname: Incomplete | None = None
|
||||
): ...
|
||||
def create_streaming_connection(self, protocol_factory, sock, on_done, ssl_context=None, server_hostname=None): ...
|
||||
|
||||
class _AsyncServiceAsyncHandle(AbstractIOReference):
|
||||
def __init__(self, subject) -> None: ...
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import abc
|
||||
from _typeshed import Incomplete
|
||||
|
||||
import pika.compat
|
||||
|
||||
@@ -21,9 +20,7 @@ class AbstractIOServices(pika.compat.AbstractBase, metaclass=abc.ABCMeta):
|
||||
@abc.abstractmethod
|
||||
def connect_socket(self, sock, resolved_addr, on_done): ...
|
||||
@abc.abstractmethod
|
||||
def create_streaming_connection(
|
||||
self, protocol_factory, sock, on_done, ssl_context: Incomplete | None = None, server_hostname: Incomplete | None = None
|
||||
): ...
|
||||
def create_streaming_connection(self, protocol_factory, sock, on_done, ssl_context=None, server_hostname=None): ...
|
||||
|
||||
class AbstractFileDescriptorServices(pika.compat.AbstractBase, metaclass=abc.ABCMeta):
|
||||
@abc.abstractmethod
|
||||
|
||||
@@ -57,7 +57,7 @@ class SelectorIOServicesAdapter(
|
||||
class _FileDescriptorCallbacks:
|
||||
reader: Incomplete
|
||||
writer: Incomplete
|
||||
def __init__(self, reader: Incomplete | None = None, writer: Incomplete | None = None) -> None: ...
|
||||
def __init__(self, reader=None, writer=None) -> None: ...
|
||||
|
||||
class _TimerHandle(nbio_interface.AbstractTimerReference):
|
||||
def __init__(self, handle, loop) -> None: ...
|
||||
|
||||
@@ -26,7 +26,7 @@ class CallbackManager:
|
||||
callback: Callable[[Incomplete], Incomplete],
|
||||
one_shot: bool = True,
|
||||
only_caller: object | None = None,
|
||||
arguments: Incomplete | None = None,
|
||||
arguments=None,
|
||||
) -> tuple[str | int, str | object]: ...
|
||||
def clear(self) -> None: ...
|
||||
def cleanup(self, prefix: str | int) -> bool: ...
|
||||
@@ -37,6 +37,6 @@ class CallbackManager:
|
||||
prefix: str | int,
|
||||
key: str | object,
|
||||
callback_value: Callable[[Incomplete], Incomplete] | None = None,
|
||||
arguments: Incomplete | None = None,
|
||||
arguments=None,
|
||||
) -> Literal[True]: ...
|
||||
def remove_all(self, prefix: str | int, key: str | object) -> None: ...
|
||||
|
||||
@@ -171,7 +171,7 @@ class Connection(AbstractBase, metaclass=abc.ABCMeta):
|
||||
def channel(
|
||||
self, channel_number: int | None = None, on_open_callback: Callable[[Channel], object] | None = None
|
||||
) -> Channel: ...
|
||||
def update_secret(self, new_secret, reason, callback: Incomplete | None = None) -> None: ...
|
||||
def update_secret(self, new_secret, reason, callback=None) -> None: ...
|
||||
def close(self, reply_code: int = 200, reply_text: str = "Normal shutdown") -> None: ...
|
||||
@property
|
||||
def is_closed(self) -> bool: ...
|
||||
|
||||
+22
-77
@@ -155,13 +155,7 @@ class Connection(Class):
|
||||
reply_text: Incomplete
|
||||
class_id: Incomplete
|
||||
method_id: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
reply_code: Incomplete | None = None,
|
||||
reply_text: _str = "",
|
||||
class_id: Incomplete | None = None,
|
||||
method_id: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, reply_code=None, reply_text: _str = "", class_id=None, method_id=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -256,13 +250,7 @@ class Channel(Class):
|
||||
reply_text: Incomplete
|
||||
class_id: Incomplete
|
||||
method_id: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
reply_code: Incomplete | None = None,
|
||||
reply_text: _str = "",
|
||||
class_id: Incomplete | None = None,
|
||||
method_id: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, reply_code=None, reply_text: _str = "", class_id=None, method_id=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -327,14 +315,14 @@ class Exchange(Class):
|
||||
def __init__(
|
||||
self,
|
||||
ticket: int = 0,
|
||||
exchange: Incomplete | None = None,
|
||||
exchange=None,
|
||||
type=...,
|
||||
passive: bool = False,
|
||||
durable: bool = False,
|
||||
auto_delete: bool = False,
|
||||
internal: bool = False,
|
||||
nowait: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
arguments=None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
@@ -355,9 +343,7 @@ class Exchange(Class):
|
||||
exchange: Incomplete
|
||||
if_unused: Incomplete
|
||||
nowait: bool
|
||||
def __init__(
|
||||
self, ticket: int = 0, exchange: Incomplete | None = None, if_unused: bool = False, nowait: bool = False
|
||||
) -> None: ...
|
||||
def __init__(self, ticket: int = 0, exchange=None, if_unused: bool = False, nowait: bool = False) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -380,13 +366,7 @@ class Exchange(Class):
|
||||
nowait: bool
|
||||
arguments: Incomplete | None
|
||||
def __init__(
|
||||
self,
|
||||
ticket: int = 0,
|
||||
destination: Incomplete | None = None,
|
||||
source: Incomplete | None = None,
|
||||
routing_key: _str = "",
|
||||
nowait: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
self, ticket: int = 0, destination=None, source=None, routing_key: _str = "", nowait: bool = False, arguments=None
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
@@ -410,13 +390,7 @@ class Exchange(Class):
|
||||
nowait: bool
|
||||
arguments: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
ticket: int = 0,
|
||||
destination: Incomplete | None = None,
|
||||
source: Incomplete | None = None,
|
||||
routing_key: _str = "",
|
||||
nowait: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
self, ticket: int = 0, destination=None, source=None, routing_key: _str = "", nowait: bool = False, arguments=None
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
@@ -453,7 +427,7 @@ class Queue(Class):
|
||||
exclusive: bool = False,
|
||||
auto_delete: bool = False,
|
||||
nowait: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
arguments=None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
@@ -480,13 +454,7 @@ class Queue(Class):
|
||||
nowait: bool
|
||||
arguments: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
ticket: int = 0,
|
||||
queue: _str = "",
|
||||
exchange: Incomplete | None = None,
|
||||
routing_key: _str = "",
|
||||
nowait: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
self, ticket: int = 0, queue: _str = "", exchange=None, routing_key: _str = "", nowait: bool = False, arguments=None
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
@@ -515,7 +483,7 @@ class Queue(Class):
|
||||
class PurgeOk(Method):
|
||||
INDEX: ClassVar[int]
|
||||
message_count: Incomplete
|
||||
def __init__(self, message_count: Incomplete | None = None) -> None: ...
|
||||
def __init__(self, message_count=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -539,7 +507,7 @@ class Queue(Class):
|
||||
class DeleteOk(Method):
|
||||
INDEX: ClassVar[int]
|
||||
message_count: Incomplete
|
||||
def __init__(self, message_count: Incomplete | None = None) -> None: ...
|
||||
def __init__(self, message_count=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -552,14 +520,7 @@ class Queue(Class):
|
||||
exchange: Incomplete
|
||||
routing_key: Incomplete
|
||||
arguments: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
ticket: int = 0,
|
||||
queue: _str = "",
|
||||
exchange: Incomplete | None = None,
|
||||
routing_key: _str = "",
|
||||
arguments: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, ticket: int = 0, queue: _str = "", exchange=None, routing_key: _str = "", arguments=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -614,7 +575,7 @@ class Basic(Class):
|
||||
no_ack: bool = False,
|
||||
exclusive: bool = False,
|
||||
nowait: bool = False,
|
||||
arguments: Incomplete | None = None,
|
||||
arguments=None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
@@ -624,7 +585,7 @@ class Basic(Class):
|
||||
class ConsumeOk(Method):
|
||||
INDEX: ClassVar[int]
|
||||
consumer_tag: Incomplete
|
||||
def __init__(self, consumer_tag: Incomplete | None = None) -> None: ...
|
||||
def __init__(self, consumer_tag=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -634,7 +595,7 @@ class Basic(Class):
|
||||
INDEX: ClassVar[int]
|
||||
consumer_tag: Incomplete
|
||||
nowait: bool
|
||||
def __init__(self, consumer_tag: Incomplete | None = None, nowait: bool = False) -> None: ...
|
||||
def __init__(self, consumer_tag=None, nowait: bool = False) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[True]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -643,7 +604,7 @@ class Basic(Class):
|
||||
class CancelOk(Method):
|
||||
INDEX: ClassVar[int]
|
||||
consumer_tag: Incomplete
|
||||
def __init__(self, consumer_tag: Incomplete | None = None) -> None: ...
|
||||
def __init__(self, consumer_tag=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -670,13 +631,7 @@ class Basic(Class):
|
||||
reply_text: Incomplete
|
||||
exchange: Incomplete
|
||||
routing_key: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
reply_code: Incomplete | None = None,
|
||||
reply_text: _str = "",
|
||||
exchange: Incomplete | None = None,
|
||||
routing_key: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def __init__(self, reply_code=None, reply_text: _str = "", exchange=None, routing_key=None) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -690,12 +645,7 @@ class Basic(Class):
|
||||
exchange: Incomplete
|
||||
routing_key: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
consumer_tag: Incomplete | None = None,
|
||||
delivery_tag: Incomplete | None = None,
|
||||
redelivered: bool = False,
|
||||
exchange: Incomplete | None = None,
|
||||
routing_key: Incomplete | None = None,
|
||||
self, consumer_tag=None, delivery_tag=None, redelivered: bool = False, exchange=None, routing_key=None
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
@@ -721,12 +671,7 @@ class Basic(Class):
|
||||
routing_key: Incomplete
|
||||
message_count: Incomplete
|
||||
def __init__(
|
||||
self,
|
||||
delivery_tag: Incomplete | None = None,
|
||||
redelivered: bool = False,
|
||||
exchange: Incomplete | None = None,
|
||||
routing_key: Incomplete | None = None,
|
||||
message_count: Incomplete | None = None,
|
||||
self, delivery_tag=None, redelivered: bool = False, exchange=None, routing_key=None, message_count=None
|
||||
) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
@@ -756,7 +701,7 @@ class Basic(Class):
|
||||
INDEX: ClassVar[int]
|
||||
delivery_tag: Incomplete
|
||||
requeue: bool
|
||||
def __init__(self, delivery_tag: Incomplete | None = None, requeue: bool = True) -> None: ...
|
||||
def __init__(self, delivery_tag=None, requeue: bool = True) -> None: ...
|
||||
@property
|
||||
def synchronous(self) -> Literal[False]: ...
|
||||
def decode(self, encoded: bytes, offset: int = 0) -> Self: ...
|
||||
@@ -907,12 +852,12 @@ class BasicProperties(Properties):
|
||||
content_encoding: _str | None = None,
|
||||
headers: _ArgumentMapping | None = None,
|
||||
delivery_mode: DeliveryMode | Literal[1, 2] | None = None,
|
||||
priority: Incomplete | None = None,
|
||||
priority=None,
|
||||
correlation_id: _str | None = None,
|
||||
reply_to: _str | None = None,
|
||||
expiration: _str | None = None,
|
||||
message_id: _str | None = None,
|
||||
timestamp: Incomplete | None = None,
|
||||
timestamp=None,
|
||||
type: _str | None = None,
|
||||
user_id: _str | None = None,
|
||||
app_id: _str | None = None,
|
||||
|
||||
Reference in New Issue
Block a user