From d1d9b98affba0302ebaa1f8030e69406b74cf9c3 Mon Sep 17 00:00:00 2001 From: Jason Heiss Date: Sat, 27 Aug 2022 08:11:26 -0700 Subject: [PATCH] `imaplib.Time2Internaldate` also takes `datetime`s and 9-element tuples (#8630) Co-authored-by: Alex Waygood --- stdlib/imaplib.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/imaplib.pyi b/stdlib/imaplib.pyi index 804826f5e..bd3d0777d 100644 --- a/stdlib/imaplib.pyi +++ b/stdlib/imaplib.pyi @@ -4,6 +4,7 @@ import time from _typeshed import Self from builtins import list as _list # conflicts with a method named "list" from collections.abc import Callable +from datetime import datetime from re import Pattern from socket import socket as _socket from ssl import SSLContext, SSLSocket @@ -159,4 +160,4 @@ class _Authenticator: def Internaldate2tuple(resp: bytes) -> time.struct_time: ... def Int2AP(num: int) -> str: ... def ParseFlags(resp: bytes) -> tuple[bytes, ...]: ... -def Time2Internaldate(date_time: float | time.struct_time | str) -> str: ... +def Time2Internaldate(date_time: float | time.struct_time | time._TimeTuple | datetime | str) -> str: ...