mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
# See https://docs.python.org/3/library/time.html
|
||||
|
||||
import sys
|
||||
from typing import Any, NamedTuple, Tuple, Union, Optional
|
||||
from typing import Any, NamedTuple, Optional, Tuple, Union
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
from types import SimpleNamespace
|
||||
|
||||
@@ -15,12 +16,12 @@ daylight: int
|
||||
timezone: int
|
||||
tzname: Tuple[str, str]
|
||||
|
||||
if sys.version_info >= (3, 7) and sys.platform != 'win32':
|
||||
if sys.version_info >= (3, 7) and sys.platform != "win32":
|
||||
CLOCK_BOOTTIME: int # Linux
|
||||
CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD
|
||||
CLOCK_UPTIME: int # FreeBSD, OpenBSD
|
||||
|
||||
if sys.version_info >= (3, 3) and sys.platform != 'win32':
|
||||
if sys.version_info >= (3, 3) and sys.platform != "win32":
|
||||
CLOCK_HIGHRES: int # Solaris only
|
||||
CLOCK_MONOTONIC: int # Unix only
|
||||
CLOCK_MONOTONIC_RAW: int # Linux 2.6.28 or later
|
||||
@@ -41,13 +42,13 @@ class _struct_time(NamedTuple):
|
||||
tm_wday: int
|
||||
tm_yday: int
|
||||
tm_isdst: int
|
||||
|
||||
@property
|
||||
def n_fields(self) -> int: ...
|
||||
@property
|
||||
def n_sequence_fields(self) -> int: ...
|
||||
@property
|
||||
def n_unnamed_fields(self) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class struct_time(_struct_time):
|
||||
def __init__(
|
||||
@@ -55,7 +56,7 @@ if sys.version_info >= (3, 3):
|
||||
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]
|
||||
Tuple[int, int, int, int, int, int, int, int, int, str, int],
|
||||
],
|
||||
_arg: Any = ...,
|
||||
) -> None: ...
|
||||
@@ -64,7 +65,7 @@ if sys.version_info >= (3, 3):
|
||||
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]
|
||||
Tuple[int, int, int, int, int, int, int, int, int, str, int],
|
||||
],
|
||||
_arg: Any = ...,
|
||||
) -> struct_time: ...
|
||||
@@ -72,14 +73,17 @@ if sys.version_info >= (3, 3):
|
||||
def tm_zone(self) -> str: ...
|
||||
@property
|
||||
def tm_gmtoff(self) -> int: ...
|
||||
|
||||
else:
|
||||
class struct_time(_struct_time):
|
||||
def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ...
|
||||
def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ...
|
||||
|
||||
def asctime(t: Union[_TimeTuple, struct_time] = ...) -> str: ...
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(secs: Optional[float] = ...) -> str: ...
|
||||
def gmtime(secs: Optional[float] = ...) -> struct_time: ...
|
||||
def localtime(secs: Optional[float] = ...) -> struct_time: ...
|
||||
@@ -88,7 +92,8 @@ def sleep(secs: float) -> None: ...
|
||||
def strftime(format: str, t: Union[_TimeTuple, struct_time] = ...) -> str: ...
|
||||
def strptime(string: str, format: str = ...) -> struct_time: ...
|
||||
def time() -> float: ...
|
||||
if sys.platform != 'win32':
|
||||
|
||||
if sys.platform != "win32":
|
||||
def tzset() -> None: ... # Unix only
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
@@ -96,7 +101,7 @@ if sys.version_info >= (3, 3):
|
||||
def monotonic() -> float: ...
|
||||
def perf_counter() -> float: ...
|
||||
def process_time() -> float: ...
|
||||
if sys.platform != 'win32':
|
||||
if sys.platform != "win32":
|
||||
def clock_getres(clk_id: int) -> float: ... # Unix only
|
||||
def clock_gettime(clk_id: int) -> float: ... # Unix only
|
||||
def clock_settime(clk_id: int, time: float) -> None: ... # Unix only
|
||||
|
||||
Reference in New Issue
Block a user