python: Type ‘format’ parameter as optional
authorJo Sutton <josutton@catalyst.net.nz>
Mon, 4 Mar 2024 23:32:16 +0000 (12:32 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 21 Mar 2024 03:12:33 +0000 (03:12 +0000)
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/nt_time.py

index 559ff7ca0daba9f8c976e5f8dfb57a9e49efd451..ff6f1fb940ca72511b991bc4fe8188689afbd796 100644 (file)
@@ -18,7 +18,7 @@
 #
 
 import datetime
-from typing import NewType
+from typing import NewType, Optional
 import re
 
 
@@ -107,7 +107,7 @@ def nt_time_from_string(s: str) -> NtTime:
     return nt_time_from_datetime(dt)
 
 
-def string_from_nt_time(nttime: NtTime, format:str=None) -> str:
+def string_from_nt_time(nttime: NtTime, format: Optional[str] = None) -> str:
     """Format an NtTime date as a string.
 
     If format is not provided, an ISO 8601 string is used.