xmlstream.disconnect: typing hints

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-04-24 23:35:06 +01:00
parent 60a7a5b8df
commit 4bb81228ae
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -12,6 +12,8 @@
:license: MIT, see LICENSE for more details
"""
from typing import Optional
import functools
import logging
import socket as Socket
@ -463,7 +465,7 @@ class XMLStream(asyncio.BaseProtocol):
self._current_connection_attempt.cancel()
self._current_connection_attempt = None
def disconnect(self, wait=2.0, reason=None):
def disconnect(self, wait: float = 2.0, reason: Optional[str] = None) -> None:
"""Close the XML stream and wait for an acknowldgement from the server for
at most `wait` seconds. After the given number of seconds has
passed without a response from the serveur, or when the server