You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation in Python produces a magical object that unpacks as a 9-tuple but has two additional fields (tm_zone, tm_gmtoff) that are only accessible by name. I'm not even sure how to express that in a typing stub.
The best I can think of is to make a class that inherits from a NamedTuple with 9 fields and then adds the two additional fields. Something like
classN(NamedTuple):
tm_year: int# etcclassstruct_tm(N):
tm_zone: strtm_gmtoff: int
But pick a better name than N and handle the version-specific code in time.pyi.
The following code:
produces the following output:
reveal_type(gmtime)
produces the following output:Revealed type is 'def (secs: Union[builtins.float, None] =) -> Tuple[builtins.int, builtins.int, builtins.int, builtins.int, builtins.int, builtins.int, builtins.int, builtins.int, builtins.int, builtins.str, builtins.int, fallback=time.struct_time]
The text was updated successfully, but these errors were encountered: