mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-03 14:38:28 +08:00
Add __slots__ to third-party packages using stubdefaulter (#14619)
This commit is contained in:
@@ -13,6 +13,7 @@ from ..spec import BasicProperties
|
||||
LOGGER: Logger
|
||||
|
||||
class _CallbackResult:
|
||||
__slots__ = ("_value_class", "_ready", "_values")
|
||||
def __init__(self, value_class=None) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
@@ -37,11 +38,13 @@ class _IoloopTimerContext:
|
||||
def is_ready(self): ...
|
||||
|
||||
class _TimerEvt:
|
||||
__slots__ = ("timer_id", "_callback")
|
||||
timer_id: Incomplete
|
||||
def __init__(self, callback) -> None: ...
|
||||
def dispatch(self) -> None: ...
|
||||
|
||||
class _ConnectionBlockedUnblockedEvtBase:
|
||||
__slots__ = ("_callback", "_method_frame")
|
||||
def __init__(self, callback, method_frame) -> None: ...
|
||||
def dispatch(self) -> None: ...
|
||||
|
||||
@@ -91,18 +94,21 @@ class BlockingConnection:
|
||||
class _ChannelPendingEvt: ...
|
||||
|
||||
class _ConsumerDeliveryEvt(_ChannelPendingEvt):
|
||||
__slots__ = ("method", "properties", "body")
|
||||
method: Incomplete
|
||||
properties: Incomplete
|
||||
body: Incomplete
|
||||
def __init__(self, method, properties, body) -> None: ...
|
||||
|
||||
class _ConsumerCancellationEvt(_ChannelPendingEvt):
|
||||
__slots__ = ("method_frame",)
|
||||
method_frame: Incomplete
|
||||
def __init__(self, method_frame) -> None: ...
|
||||
@property
|
||||
def method(self): ...
|
||||
|
||||
class _ReturnedMessageEvt(_ChannelPendingEvt):
|
||||
__slots__ = ("callback", "channel", "method", "properties", "body")
|
||||
callback: Incomplete
|
||||
channel: Incomplete
|
||||
method: Incomplete
|
||||
@@ -112,12 +118,14 @@ class _ReturnedMessageEvt(_ChannelPendingEvt):
|
||||
def dispatch(self) -> None: ...
|
||||
|
||||
class ReturnedMessage:
|
||||
__slots__ = ("method", "properties", "body")
|
||||
method: Incomplete
|
||||
properties: Incomplete
|
||||
body: Incomplete
|
||||
def __init__(self, method, properties, body) -> None: ...
|
||||
|
||||
class _ConsumerInfo:
|
||||
__slots__ = ("consumer_tag", "auto_ack", "on_message_callback", "alternate_event_sink", "state")
|
||||
SETTING_UP: int
|
||||
ACTIVE: int
|
||||
TEARING_DOWN: int
|
||||
@@ -138,6 +146,7 @@ class _ConsumerInfo:
|
||||
def cancelled_by_broker(self): ...
|
||||
|
||||
class _QueueConsumerGeneratorInfo:
|
||||
__slots__ = ("params", "consumer_tag", "pending_events")
|
||||
params: Incomplete
|
||||
consumer_tag: Incomplete
|
||||
pending_events: Incomplete
|
||||
|
||||
@@ -49,6 +49,7 @@ class _GeventIOLoopIOHandle(AbstractIOReference):
|
||||
def cancel(self): ...
|
||||
|
||||
class _GeventAddressResolver:
|
||||
__slots__ = ("_loop", "_on_done", "_greenlet", "_ga_host", "_ga_port", "_ga_family", "_ga_socktype", "_ga_proto", "_ga_flags")
|
||||
def __init__(self, native_loop, host, port, family, socktype, proto, flags, on_done) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
def cancel(self): ...
|
||||
|
||||
@@ -23,6 +23,7 @@ class SelectConnection(BaseConnection):
|
||||
def create_connection(cls, connection_configs, on_done, custom_ioloop=None, workflow=None): ...
|
||||
|
||||
class _Timeout:
|
||||
__slots__ = ("deadline", "callback")
|
||||
deadline: Incomplete
|
||||
callback: Incomplete
|
||||
def __init__(self, deadline, callback) -> None: ...
|
||||
|
||||
@@ -55,6 +55,7 @@ class SelectorIOServicesAdapter(
|
||||
def remove_writer(self, fd): ...
|
||||
|
||||
class _FileDescriptorCallbacks:
|
||||
__slots__ = ("reader", "writer")
|
||||
reader: Incomplete
|
||||
writer: Incomplete
|
||||
def __init__(self, reader=None, writer=None) -> None: ...
|
||||
|
||||
@@ -17,6 +17,24 @@ PRODUCT: str
|
||||
LOGGER: Logger
|
||||
|
||||
class Parameters:
|
||||
__slots__ = (
|
||||
"_blocked_connection_timeout",
|
||||
"_channel_max",
|
||||
"_client_properties",
|
||||
"_connection_attempts",
|
||||
"_credentials",
|
||||
"_frame_max",
|
||||
"_heartbeat",
|
||||
"_host",
|
||||
"_locale",
|
||||
"_port",
|
||||
"_retry_delay",
|
||||
"_socket_timeout",
|
||||
"_stack_timeout",
|
||||
"_ssl_options",
|
||||
"_virtual_host",
|
||||
"_tcp_options",
|
||||
)
|
||||
DEFAULT_USERNAME: str
|
||||
DEFAULT_PASSWORD: str
|
||||
DEFAULT_BLOCKED_CONNECTION_TIMEOUT: None
|
||||
@@ -106,6 +124,7 @@ class Parameters:
|
||||
def tcp_options(self, value: dict[Incomplete, Incomplete] | None) -> None: ...
|
||||
|
||||
class ConnectionParameters(Parameters):
|
||||
__slots__ = ()
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
@@ -127,9 +146,11 @@ class ConnectionParameters(Parameters):
|
||||
) -> None: ...
|
||||
|
||||
class URLParameters(Parameters):
|
||||
__slots__ = ("_all_url_query_values",)
|
||||
def __init__(self, url: str) -> None: ...
|
||||
|
||||
class SSLOptions:
|
||||
__slots__ = ("context", "server_hostname")
|
||||
context: ssl.SSLContext
|
||||
server_hostname: str | None
|
||||
def __init__(self, context: ssl.SSLContext, server_hostname: str | None = None) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user