mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Add __new__ to time.struct_time (#1394)
This is needed because otherwise pytype uses the `__new__` inherited from the `NamedTuple` base class.
This commit is contained in:
committed by
Guido van Rossum
parent
0679e0232c
commit
16ec7cbdf0
@@ -45,6 +45,15 @@ if sys.version_info >= (3, 3):
|
||||
],
|
||||
_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]
|
||||
],
|
||||
_arg: Any = ...,
|
||||
) -> struct_time: ...
|
||||
else:
|
||||
class struct_time(
|
||||
NamedTuple(
|
||||
@@ -55,6 +64,7 @@ else:
|
||||
)
|
||||
):
|
||||
def __init__(self, o: TimeTuple, _arg: Any = ...) -> None: ...
|
||||
def __new__(cls, o: TimeTuple, _arg: Any = ...) -> struct_time: ...
|
||||
|
||||
|
||||
# ----- functions -----
|
||||
|
||||
Reference in New Issue
Block a user