Args is a predefined attribute on BaseException, and always Tuple[Any, ...] (#666)

This commit is contained in:
TrueBrain
2016-11-06 00:33:58 +01:00
committed by Guido van Rossum
parent cecb64b59f
commit 341c4edc37
4 changed files with 4 additions and 11 deletions

View File

@@ -14,30 +14,25 @@ class Error(Exception):
class NoSectionError(Error):
section = ... # type: str
args = ... # type: Tuple[str]
def __init__(self, section: str) -> None: ...
class DuplicateSectionError(Error):
section = ... # type: str
args = ... # type: Tuple[str]
def __init__(self, section: str) -> None: ...
class NoOptionError(Error):
section = ... # type: str
option = ... # type: str
args = ... # type: Tuple[str,str]
def __init__(self, option: str, section: str) -> None: ...
class InterpolationError(Error):
section = ... # type: str
option = ... # type: str
msg = ... # type: str
args = ... # type: Tuple[str,str,str]
def __init__(self, option: str, section: str, msg: str) -> None: ...
class InterpolationMissingOptionError(InterpolationError):
reference = ... # type: str
args = ... # type: Tuple[str,str,str,str]
def __init__(self, option: str, section: str, rawval: str, reference: str) -> None: ...
class InterpolationSyntaxError(InterpolationError): ...
@@ -48,14 +43,12 @@ class InterpolationDepthError(InterpolationError):
class ParsingError(Error):
filename = ... # type: str
errors = ... # type: list[Tuple[Any,Any]]
args = ... # type: Tuple[str]
def __init__(self, filename: str) -> None: ...
def append(self, lineno: Any, line: Any) -> None: ...
class MissingSectionHeaderError(ParsingError):
lineno = ... # type: Any
line = ... # type: Any
args = ... # type: Tuple[str,Any,Any]
def __init__(self, filename: str, lineno: Any, line: Any) -> None: ...

View File

@@ -833,7 +833,7 @@ class memoryview(Sized, Container[bytes]):
def tolist(self) -> List[int]: ...
class BaseException:
args = ... # type: Any
args = ... # type: Tuple[Any, ...]
message = ... # type: str
def __init__(self, *args: Any) -> None: ...
def with_traceback(self, tb: Any) -> BaseException: ...

View File

@@ -1,11 +1,11 @@
from typing import Any, List, Optional
from typing import Any, Tuple, Optional
class StandardError(Exception): ...
class ArithmeticError(StandardError): ...
class AssertionError(StandardError): ...
class AttributeError(StandardError): ...
class BaseException(object):
args = ... # type: List[Any]
args = ... # type: Tuple[Any, ...]
message = ... # type: str
def __getslice__(self, start, end) -> Any: ...
def __getitem__(self, start, end) -> Any: ...