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 types import ModuleType, TracebackType
from typing import Any, List, Optional, TextIO, Type, Union, overload
from typing_extensions import Literal
@@ -31,28 +30,17 @@ class WarningMessage:
lineno: int
file: Optional[TextIO]
line: Optional[str]
if sys.version_info >= (3, 6):
source: Optional[Any]
def __init__(
self,
message: Union[Warning, str],
category: Type[Warning],
filename: str,
lineno: int,
file: Optional[TextIO] = ...,
line: Optional[str] = ...,
source: Optional[Any] = ...,
) -> None: ...
else:
def __init__(
self,
message: Union[Warning, str],
category: Type[Warning],
filename: str,
lineno: int,
file: Optional[TextIO] = ...,
line: Optional[str] = ...,
) -> None: ...
source: Optional[Any]
def __init__(
self,
message: Union[Warning, str],
category: Type[Warning],
filename: str,
lineno: int,
file: Optional[TextIO] = ...,
line: Optional[str] = ...,
source: Optional[Any] = ...,
) -> None: ...
class catch_warnings:
@overload