Closed VincentVanlaer closed 1 year ago
This allows Listener[SubTypeOfStream] to be a subtype of Listener[Stream]. In this way the following function typechecks
Listener[SubTypeOfStream]
Listener[Stream]
async def open_listener( port: int, should_use_ssl: bool ) -> Sequence[Listener[Stream]]: if should_use_ssl: return await open_ssl_over_tcp_listeners(port, ssl.create_default_context()) else: return await open_tcp_listeners(port)
This allows
Listener[SubTypeOfStream]
to be a subtype ofListener[Stream]
. In this way the following function typechecks