Skip to content

time.time_struct should be a 9-tuple with 2 extra properties in python3.3+ #3297

@gwk

Description

@gwk

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions