Skip to content

Commit 29f78dd

Browse files
Amend annotation for asyncio.Protocol.__slots__ (#14980)
1 parent 546dd28 commit 29f78dd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

stdlib/asyncio/protocols.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BaseProtocol:
1414

1515
class Protocol(BaseProtocol):
1616
# Need annotation or mypy will complain about 'Cannot determine type of "__slots__" in base class'
17-
__slots__: tuple[()] = ()
17+
__slots__: tuple[str, ...] = ()
1818
def data_received(self, data: bytes) -> None: ...
1919
def eof_received(self) -> bool | None: ...
2020

@@ -35,7 +35,7 @@ class DatagramProtocol(BaseProtocol):
3535
def error_received(self, exc: Exception) -> None: ...
3636

3737
class SubprocessProtocol(BaseProtocol):
38-
__slots__: tuple[()] = ()
38+
__slots__: tuple[str, ...] = ()
3939
def pipe_data_received(self, fd: int, data: bytes) -> None: ...
4040
def pipe_connection_lost(self, fd: int, exc: Exception | None) -> None: ...
4141
def process_exited(self) -> None: ...

stubs/protobuf/google/protobuf/internal/well_known_types.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ _StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | float
6767
_StructValueArg: TypeAlias = _StructValue | Mapping[str, _StructValueArg] | Sequence[_StructValueArg]
6868

6969
class Struct:
70-
__slots__: tuple[()] = ()
70+
__slots__: tuple[str, ...] = ()
7171
def __getitem__(self, key: str) -> _StructValue: ...
7272
def __setitem__(self, key: str, value: _StructValueArg) -> None: ...
7373
def __delitem__(self, key: str) -> None: ...
@@ -81,7 +81,7 @@ class Struct:
8181
def update(self, dictionary: SupportsItems[str, _StructValueArg]) -> None: ...
8282

8383
class ListValue:
84-
__slots__: tuple[()] = ()
84+
__slots__: tuple[str, ...] = ()
8585
def __len__(self) -> int: ...
8686
def append(self, value: _StructValue) -> None: ...
8787
def extend(self, elem_seq: Iterable[_StructValue]) -> None: ...

stubs/protobuf/google/protobuf/message.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DecodeError(Error): ...
1212
class EncodeError(Error): ...
1313

1414
class Message:
15-
__slots__: tuple[()] = ()
15+
__slots__: tuple[str, ...] = ()
1616
DESCRIPTOR: Descriptor | _upb_Descriptor
1717
def __deepcopy__(self, memo: Any = None) -> Self: ...
1818
def __eq__(self, other_msg): ...

0 commit comments

Comments
 (0)