From 5bb58af6c8151555b3d783843f29d7cb65edb408 Mon Sep 17 00:00:00 2001 From: Yusuke Miyazaki Date: Tue, 10 Jul 2018 11:02:03 +0900 Subject: [PATCH] Use float instead of Union[int, float] (#2308) --- stdlib/2/_ast.pyi | 4 ++-- stdlib/3/_ast.pyi | 4 ++-- stdlib/3/asyncio/events.pyi | 2 +- stdlib/3/importlib/abc.pyi | 2 +- third_party/3/typed_ast/ast3.pyi | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stdlib/2/_ast.pyi b/stdlib/2/_ast.pyi index a0a7a00c8..8cbf6d67b 100644 --- a/stdlib/2/_ast.pyi +++ b/stdlib/2/_ast.pyi @@ -1,5 +1,5 @@ import typing -from typing import Optional, Union +from typing import Optional __version__ = ... # type: str @@ -215,7 +215,7 @@ class Repr(expr): value = ... # type: expr class Num(expr): - n = ... # type: Union[int, float] + n = ... # type: float class Str(expr): s = ... # type: str diff --git a/stdlib/3/_ast.pyi b/stdlib/3/_ast.pyi index 07e96eb75..3a14d784f 100644 --- a/stdlib/3/_ast.pyi +++ b/stdlib/3/_ast.pyi @@ -1,6 +1,6 @@ import sys import typing -from typing import Any, Optional, Union, ClassVar +from typing import Any, Optional, ClassVar PyCF_ONLY_AST = ... # type: int @@ -233,7 +233,7 @@ class Call(expr): keywords = ... # type: typing.List[keyword] class Num(expr): - n = ... # type: Union[int, float] + n = ... # type: float class Str(expr): s = ... # type: str diff --git a/stdlib/3/asyncio/events.pyi b/stdlib/3/asyncio/events.pyi index b03d81432..c506643fc 100644 --- a/stdlib/3/asyncio/events.pyi +++ b/stdlib/3/asyncio/events.pyi @@ -66,7 +66,7 @@ class AbstractEventLoop(metaclass=ABCMeta): @abstractmethod def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... @abstractmethod - def call_later(self, delay: Union[int, float], callback: Callable[..., Any], *args: Any) -> Handle: ... + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> Handle: ... @abstractmethod def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> Handle: ... @abstractmethod diff --git a/stdlib/3/importlib/abc.pyi b/stdlib/3/importlib/abc.pyi index e8bf33e5d..c811946b2 100644 --- a/stdlib/3/importlib/abc.pyi +++ b/stdlib/3/importlib/abc.pyi @@ -46,7 +46,7 @@ class ExecutionLoader(InspectLoader): def get_code(self, fullname: str) -> Optional[types.CodeType]: ... class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): - def path_mtime(self, path: _Path) -> Union[int, float]: ... + def path_mtime(self, path: _Path) -> float: ... def set_data(self, path: _Path, data: bytes) -> None: ... def get_source(self, fullname: str) -> Optional[str]: ... def path_stats(self, path: _Path) -> Mapping[str, Any]: ... diff --git a/third_party/3/typed_ast/ast3.pyi b/third_party/3/typed_ast/ast3.pyi index 1e96daf0c..0b600af98 100644 --- a/third_party/3/typed_ast/ast3.pyi +++ b/third_party/3/typed_ast/ast3.pyi @@ -260,7 +260,7 @@ class Call(expr): keywords = ... # type: typing.List[keyword] class Num(expr): - n = ... # type: Union[int, float] + n = ... # type: float class Str(expr): s = ... # type: str