add still needed TYPE_CHECK

This commit is contained in:
Chih Cheng Liang
2019-08-05 10:35:56 +08:00
parent 87ef2e4618
commit 29091266fc
6 changed files with 22 additions and 12 deletions

View File

@ -2,11 +2,16 @@ from abc import ABC, abstractmethod
from multiaddr import Multiaddr
from libp2p.security.secure_conn_interface import ISecureConn
from libp2p.network.swarm import GenericProtocolHandlerFn
from libp2p.network.typing import GenericProtocolHandlerFn
from libp2p.peer.id import ID
from libp2p.stream_muxer.muxed_stream_interface import IMuxedStream
from libp2p.stream_muxer.mplex.constants import HeaderTags
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from libp2p.stream_muxer.muxed_stream_interface import IMuxedStream
class IMuxedConn(ABC):
"""
@ -55,7 +60,7 @@ class IMuxedConn(ABC):
@abstractmethod
async def open_stream(
self, protocol_id: str, multi_addr: Multiaddr
) -> IMuxedStream:
) -> "IMuxedStream":
"""
creates a new muxed_stream
:param protocol_id: protocol_id of stream