From 4bb81228ae806f3010c50890b6343514094d3da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 24 Apr 2019 23:35:06 +0100 Subject: [PATCH] xmlstream.disconnect: typing hints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/xmlstream/xmlstream.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 17d23ff2..ba58b8bd 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -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