Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)

* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Akuli
2021-05-15 15:33:39 +03:00
committed by GitHub
parent b0ef85288d
commit 17dcea4a68
106 changed files with 1539 additions and 3275 deletions

View File

@@ -1,4 +1,3 @@
import sys
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Text, Tuple
class Event(NamedTuple):
@@ -9,30 +8,24 @@ class Event(NamedTuple):
kwargs: Dict[Text, Any]
class scheduler:
if sys.version_info >= (3, 3):
def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ...
def enterabs(
self,
time: float,
priority: Any,
action: Callable[..., Any],
argument: Tuple[Any, ...] = ...,
kwargs: Dict[str, Any] = ...,
) -> Event: ...
def enter(
self,
delay: float,
priority: Any,
action: Callable[..., Any],
argument: Tuple[Any, ...] = ...,
kwargs: Dict[str, Any] = ...,
) -> Event: ...
def run(self, blocking: bool = ...) -> Optional[float]: ...
else:
def __init__(self, timefunc: Callable[[], float], delayfunc: Callable[[float], None]) -> None: ...
def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ...
def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ...
def run(self) -> None: ...
def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ...
def enterabs(
self,
time: float,
priority: Any,
action: Callable[..., Any],
argument: Tuple[Any, ...] = ...,
kwargs: Dict[str, Any] = ...,
) -> Event: ...
def enter(
self,
delay: float,
priority: Any,
action: Callable[..., Any],
argument: Tuple[Any, ...] = ...,
kwargs: Dict[str, Any] = ...,
) -> Event: ...
def run(self, blocking: bool = ...) -> Optional[float]: ...
def cancel(self, event: Event) -> None: ...
def empty(self) -> bool: ...
@property