mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Convert namedtuples to class syntax (#3321)
This commit is contained in:
@@ -32,15 +32,19 @@ if sys.version_info >= (3, 8) and sys.platform == "darwin":
|
||||
CLOCK_UPTIME_RAW: int
|
||||
|
||||
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)]
|
||||
)
|
||||
):
|
||||
class _struct_time(NamedTuple):
|
||||
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
|
||||
class struct_time(_struct_time):
|
||||
def __init__(
|
||||
self,
|
||||
o: Union[
|
||||
@@ -60,14 +64,17 @@ if sys.version_info >= (3, 3):
|
||||
_arg: Any = ...,
|
||||
) -> struct_time: ...
|
||||
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)]
|
||||
)
|
||||
):
|
||||
class _struct_time(NamedTuple):
|
||||
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
|
||||
class struct_time(_struct_time):
|
||||
def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ...
|
||||
def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user