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
For Python 3.3+, time.pyi represents time_struct as an 11-field NamedTuple. This is incorrect; despite the additional tm_zone and tm_gmtoff fields, it behaves as a 9-tuple: len(gmtime()) == 9. Note however that gmtime().n_fields == 11.
It appears to me that time_struct was modified to keep it's 9-tuple shape while adding two additional fields. The type stub needs to reflect this, or else mypy messes up unpacking of time_struct.
Would the correct solution be define the NamedTuple with 9 fields, plus two additional properties?
The text was updated successfully, but these errors were encountered:
For Python 3.3+,
time.pyi
representstime_struct
as an 11-field NamedTuple. This is incorrect; despite the additionaltm_zone
andtm_gmtoff
fields, it behaves as a 9-tuple:len(gmtime()) == 9
. Note however thatgmtime().n_fields == 11
.It appears to me that time_struct was modified to keep it's 9-tuple shape while adding two additional fields. The type stub needs to reflect this, or else mypy messes up unpacking of time_struct.
Would the correct solution be define the NamedTuple with 9 fields, plus two additional properties?
The text was updated successfully, but these errors were encountered: