add (overwrite with) mypy stubs, if available

This commit is contained in:
Matthias Kramm
2015-09-30 07:36:12 -07:00
parent 69e10b3aed
commit 337abed05a
432 changed files with 22360 additions and 776 deletions
+52 -38
View File
@@ -1,50 +1,64 @@
"""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.
# Stubs for time
# Ron Murawski <ron@horizonchess.com>
from typing import Any, List, Tuple, Dict, Generic
# based on: http://docs.python.org/3.2/library/time.html#module-time
# see: http://nullege.com/codes/search?cq=time
def asctime(*args, **kwargs) -> unicode: ...
from typing import Tuple, Union
# ----- variables and constants -----
accept2dyear = False
altzone = 0
daylight = 0
timezone = 0
tzname = ... # type: Tuple[str, str]
# ----- classes/methods -----
class struct_time:
# this is supposed to be a namedtuple object
# namedtuple is not yet implemented (see file: mypy/stubs/collections.py)
# see: http://docs.python.org/3.2/library/time.html#time.struct_time
# see: http://nullege.com/codes/search/time.struct_time
# TODO: namedtuple() object problem
#namedtuple __init__(self, int, int, int, int, int, int, int, int, int):
# ...
tm_year = 0
tm_mon = 0
tm_mday = 0
tm_hour = 0
tm_min = 0
tm_sec = 0
tm_wday = 0
tm_yday = 0
tm_isdst = 0
# ----- functions -----
def asctime(t: Union[Tuple[int, int, int, int, int, int, int, int, int],
struct_time,
None] = None) -> str: ... # return current time
def clock() -> float: ...
def clock_getres(a: int) -> float:
raise IOError()
def ctime(secs: Union[float, None] = None) -> str: ... # return current time
def clock_gettime(a: int) -> float:
raise IOError()
def gmtime(secs: Union[float, None] = None) -> struct_time: ... # return current time
def clock_settime(a: int, b) -> None:
raise IOError()
def localtime(secs: Union[float, None] = None) -> struct_time: ... # return current time
def ctime(*args, **kwargs) -> unicode: ...
def mktime(t: Union[Tuple[int, int, int, int, int,
int, int, int, int],
struct_time]) -> float: ...
def get_clock_info(a: str) -> Any:
raise ValueError()
def sleep(secs: Union[int, float]) -> None: ...
def gmtime(*args, **kwargs) -> tuple:
raise OSError()
def localtime(*args, **kwargs) -> tuple: ...
def mktime(*args, **kwargs) -> float:
raise OverflowError()
def monotonic() -> float: ...
def perf_counter() -> float: ...
def process_time() -> float: ...
def sleep(a: float) -> None:
raise ValueError()
def strftime(a: str, *args, **kwargs) -> unicode:
raise MemoryError()
def strptime(*args, **kwargs) -> Any: ...
def strftime(format: str, t: Union[Tuple[int, int, int, int, int,
int, int, int, int],
struct_time,
None] = None) -> str: ... # return current time
def strptime(string: str,
format: str = "%a %b %d %H:%M:%S %Y") -> struct_time: ...
def time() -> float: ...
def tzset() -> None: ...
def tzset() -> None: ... # Unix only