mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-29 07:06:55 +08:00
python2: gmtime(None), localtime(None), and ctime(None) works (#662)
This commit is contained in:
committed by
Guido van Rossum
parent
5fc1b4b948
commit
2d19599b68
@@ -1,7 +1,7 @@
|
||||
"""Stub file for the 'time' module."""
|
||||
# See https://docs.python.org/2/library/time.html
|
||||
|
||||
from typing import NamedTuple, Tuple, Union, Any
|
||||
from typing import NamedTuple, Tuple, Union, Any, Optional
|
||||
|
||||
# ----- variables and constants -----
|
||||
accept2dyear = False
|
||||
@@ -25,12 +25,12 @@ def asctime(t: struct_time = ...) -> str:
|
||||
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(secs: float = ...) -> str:
|
||||
def ctime(secs: Optional[float] = ...) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def gmtime(secs: float = ...) -> struct_time: ...
|
||||
def gmtime(secs: Optional[float] = ...) -> struct_time: ...
|
||||
|
||||
def localtime(secs: float = ...) -> struct_time: ...
|
||||
def localtime(secs: Optional[float] = ...) -> struct_time: ...
|
||||
|
||||
def mktime(t: struct_time) -> float:
|
||||
raise OverflowError()
|
||||
|
||||
Reference in New Issue
Block a user