diff sat/tools/utils.py @ 3860:e417c478b488

plugin XEP-0060, tools (utils): doc/type hints
author Goffi <goffi@goffi.org>
date Wed, 20 Jul 2022 17:18:17 +0200
parents 0a87cae85746
children 00212260f659
line wrap: on
line diff
--- a/sat/tools/utils.py	Wed Jul 20 17:12:29 2022 +0200
+++ b/sat/tools/utils.py	Wed Jul 20 17:18:17 2022 +0200
@@ -18,6 +18,7 @@
 
 """ various useful methods """
 
+from typing import Optional, Union
 import unicodedata
 import os.path
 import datetime
@@ -137,7 +138,10 @@
     return wrapper
 
 
-def xmpp_date(timestamp=None, with_time=True):
+def xmpp_date(
+    timestamp: Optional[Union[float, int]] = None,
+    with_time: bool = True
+) -> str:
     """Return date according to XEP-0082 specification
 
     to avoid reveling the timezone, we always return UTC dates