Skip to content

Bug: stub for time.gmtime() is not working correctly #7588

Closed
@jolaf

Description

@jolaf

The following code:

from time import gmtime
(a, b, c, d, e, f, g, h, i) = gmtime()
print(a, b, c, d, e, f, g, h, i)

produces the following output:

$ python3 Test.py 
2019 9 30 16 29 49 0 273 0
$ mypy Test.py
Test.py:3: error: Too many values to unpack (9 expected, 11 provided)

$ mypy --version
mypy 0.730
$ python3 --version
Python 3.6.8

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]

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