File: time.pyi

package info (click to toggle)
mypy 0.470-complete-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,864 kB
  • ctags: 3,264
  • sloc: python: 21,838; makefile: 18
file content (84 lines) | stat: -rw-r--r-- 3,071 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Stubs for time
# Ron Murawski <ron@horizonchess.com>

# based on: http://docs.python.org/3.3/library/time.html#module-time
# see: http://nullege.com/codes/search?cq=time

import sys
from typing import Any, NamedTuple, Tuple, Union
from types import SimpleNamespace

TimeTuple = Tuple[int, int, int, int, int, int, int, int, int]

# ----- variables and constants -----
accept2dyear = False
altzone = 0
daylight = 0
timezone = 0
tzname = ...  # type: Tuple[str, str]

if sys.version_info >= (3, 3) and sys.platform != 'win32':
    CLOCK_HIGHRES = 0  # Solaris only
    CLOCK_MONOTONIC = 0  # Unix only
    CLOCK_MONOTONIC_RAW = 0  # Linux 2.6.28 or later
    CLOCK_PROCESS_CPUTIME_ID = 0  # Unix only
    CLOCK_REALTIME = 0  # Unix only
    CLOCK_THREAD_CPUTIME_ID = 0  # Unix only


if sys.version_info >= (3, 3):
    class 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),
             ('tm_zone', str), ('tm_gmtoff', int)]
        )
    ):
        def __init__(
            self,
            o: Union[
                Tuple[int, int, int, int, int, int, int, int, int],
                Tuple[int, int, int, int, int, int, int, int, int, str],
                Tuple[int, int, int, int, int, int, int, int, int, str, int]
            ],
            _arg: Any = ...,
        ) -> None: ...
else:
    class 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)]
        )
    ):
        def __init__(self, o: TimeTuple, _arg: Any = ...) -> None: ...


# ----- functions -----
def asctime(t: Union[TimeTuple, struct_time, None] = ...) -> str: ...  # return current time
def clock() -> float: ...
def ctime(secs: Union[float, None] = ...) -> str: ...  # return current time
def gmtime(secs: Union[float, None] = ...) -> struct_time: ...  # return current time
def localtime(secs: Union[float, None] = ...) -> struct_time: ...  # return current time
def mktime(t: Union[TimeTuple, struct_time]) -> float: ...
def sleep(secs: Union[int, float]) -> None: ...
def strftime(format: str,
             t: Union[TimeTuple, struct_time, None] = ...) -> str: ...  # return current time
def strptime(string: str,
             format: str = ...) -> struct_time: ...
def time() -> float: ...
if sys.platform != 'win32':
    def tzset() -> None: ...  # Unix only

if sys.version_info >= (3, 3):
    def get_clock_info(str) -> SimpleNamespace: ...
    def monotonic() -> float: ...
    def perf_counter() -> float: ...
    def process_time() -> float: ...
    if sys.platform != 'win32':
        def clock_getres(int) -> float: ...  # Unix only
        def clock_gettime(int) -> float: ...  # Unix only
        def clock_settime(int, struct_time) -> float: ...  # Unix only