Skip to content

Commit c8c8ffe

Browse files
committed
Fix type annotation inconsistency in negotiate() method
- Update multiselect.py negotiate() return type to match IMultiselectMuxer interface - Allow TProtocol to be None in return type annotation - Add .tmp.driveupload/ to .gitignore to exclude temporary upload files Resolves type inconsistency between abstract interface and concrete implementation.
1 parent 3ca27c6 commit c8c8ffe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,6 @@ env.bak/
178178
#lockfiles
179179
uv.lock
180180
poetry.lock
181+
182+
# Temporary upload files
183+
.tmp.driveupload/

libp2p/protocol_muxer/multiselect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ def add_handler(
4848
"""
4949
self.handlers[protocol] = handler
5050

51-
# FIXME: Make TProtocol Optional[TProtocol] to keep types consistent
5251
async def negotiate(
5352
self,
5453
communicator: IMultiselectCommunicator,
5554
negotiate_timeout: int = DEFAULT_NEGOTIATE_TIMEOUT,
56-
) -> tuple[TProtocol, StreamHandlerFn | None]:
55+
) -> tuple[TProtocol | None, StreamHandlerFn | None]:
5756
"""
5857
Negotiate performs protocol selection.
5958

0 commit comments

Comments
 (0)