mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Add BufferError, Ellipsis to 2.7/
This commit is contained in:
@@ -725,6 +725,11 @@ def __import__(name: unicode,
|
||||
def globals() -> Dict[str, Any]: ...
|
||||
def locals() -> Dict[str, Any]: ...
|
||||
|
||||
# Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
|
||||
# not exposed anywhere under that name, we make it private here.
|
||||
class _ellipsis: ...
|
||||
Ellipsis = ... # type: _ellipsis
|
||||
|
||||
# TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check.
|
||||
AnyBuffer = TypeVar('AnyBuffer', str, unicode, bytearray, buffer)
|
||||
|
||||
@@ -749,6 +754,7 @@ class Exception(BaseException): ...
|
||||
class StopIteration(Exception): ...
|
||||
class StandardError(Exception): ...
|
||||
class ArithmeticError(StandardError): ...
|
||||
class BufferError(StandardError): ...
|
||||
class EnvironmentError(StandardError):
|
||||
errno = 0
|
||||
strerror = ''
|
||||
|
||||
@@ -712,11 +712,10 @@ def __import__(name: str, globals: Dict[str, Any] = {}, locals: Dict[str, Any] =
|
||||
|
||||
# Ellipsis
|
||||
|
||||
class ellipsis:
|
||||
# TODO not defined in builtins!
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
Ellipsis = ellipsis()
|
||||
# Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
|
||||
# not exposed anywhere under that name, we make it private here.
|
||||
class _ellipsis: ...
|
||||
Ellipsis = ... # type: _ellipsis
|
||||
|
||||
# Exceptions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user