mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
from typing import Any, NamedTuple, Optional, Tuple, Union
|
||||
from typing import Any, NamedTuple, Tuple
|
||||
|
||||
_TimeTuple = Tuple[int, int, int, int, int, int, int, int, int]
|
||||
|
||||
@@ -51,20 +51,16 @@ class _struct_time(NamedTuple):
|
||||
class struct_time(_struct_time):
|
||||
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],
|
||||
],
|
||||
o: 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: ...
|
||||
def __new__(
|
||||
cls,
|
||||
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],
|
||||
],
|
||||
o: 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 = ...,
|
||||
) -> struct_time: ...
|
||||
@property
|
||||
@@ -72,17 +68,17 @@ class struct_time(_struct_time):
|
||||
@property
|
||||
def tm_gmtoff(self) -> int: ...
|
||||
|
||||
def asctime(t: Union[_TimeTuple, struct_time] = ...) -> str: ...
|
||||
def asctime(t: _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: ...
|
||||
def mktime(t: Union[_TimeTuple, struct_time]) -> float: ...
|
||||
def ctime(secs: float | None = ...) -> str: ...
|
||||
def gmtime(secs: float | None = ...) -> struct_time: ...
|
||||
def localtime(secs: float | None = ...) -> struct_time: ...
|
||||
def mktime(t: _TimeTuple | struct_time) -> float: ...
|
||||
def sleep(secs: float) -> None: ...
|
||||
def strftime(format: str, t: Union[_TimeTuple, struct_time] = ...) -> str: ...
|
||||
def strftime(format: str, t: _TimeTuple | struct_time = ...) -> str: ...
|
||||
def strptime(string: str, format: str = ...) -> struct_time: ...
|
||||
def time() -> float: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user