mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 04:52:23 +08:00
Improve several stubs. (math, _random, time, etc.)
Some of these are derived from mypy/stubs/.
This commit is contained in:
38
2.7/time.pyi
38
2.7/time.pyi
@@ -1,32 +1,46 @@
|
||||
"""Stub file for the 'time' module."""
|
||||
# This is an autogenerated file. It serves as a starting point
|
||||
# for a more precise manual annotation of this module.
|
||||
# Feel free to edit the source below, but remove this header when you do.
|
||||
# See https://docs.python.org/2/library/time.html
|
||||
|
||||
from typing import Any, List, Tuple, Dict, GenericType
|
||||
from typing import NamedTuple, Tuple, Union
|
||||
|
||||
def asctime(*args, **kwargs) -> str:
|
||||
# ----- variables and constants -----
|
||||
accept2dyear = False
|
||||
altzone = 0
|
||||
daylight = 0
|
||||
timezone = 0
|
||||
tzname = ... # type: Tuple[str, str]
|
||||
|
||||
struct_time = NamedTuple('struct_time',
|
||||
[('tm_year', int), ('tm_mon', int), ('tm_mday', int),
|
||||
('tm_hour', int), ('tm_min', int), ('tm_sec', int),
|
||||
('tm_wday', int), ('tm_yday', int), ('tm_isdst', int)])
|
||||
|
||||
_TIME_TUPLE = Tuple[int, int, int, int, int, int, int, int, int]
|
||||
|
||||
def asctime(t: struct_time = None) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(*args, **kwargs) -> str:
|
||||
def ctime(secs: float = None) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def gmtime(*args, **kwargs) -> tuple: ...
|
||||
def gmtime(secs: float = None) -> struct_time: ...
|
||||
|
||||
def localtime(*args, **kwargs) -> tuple: ...
|
||||
def localtime(secs: float = None) -> struct_time: ...
|
||||
|
||||
def mktime(*args, **kwargs) -> float:
|
||||
def mktime(t: struct_time) -> float:
|
||||
raise OverflowError()
|
||||
raise ValueError()
|
||||
|
||||
def sleep(a: float) -> None: ...
|
||||
def sleep(secs: float) -> None: ...
|
||||
|
||||
def strftime(a: str, *args, **kwargs) -> str:
|
||||
def strftime(format: str, t: struct_time = None) -> str:
|
||||
raise MemoryError()
|
||||
raise ValueError()
|
||||
|
||||
def strptime(*args, **kwargs) -> Any: ...
|
||||
def strptime(string: str, format: str = "%a %b %d %H:%M:%S %Y") -> struct_time:
|
||||
raise ValueError()
|
||||
|
||||
def time() -> float:
|
||||
raise IOError()
|
||||
|
||||
Reference in New Issue
Block a user