From e158a97ab2fdeb54a428db51c2fa8ec812133cf0 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Wed, 21 Oct 2015 10:51:12 -0700 Subject: [PATCH] Add BufferError, Ellipsis to 2.7/ --- builtins/2.7/__builtin__.pyi | 6 ++++++ builtins/3/builtins.pyi | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/builtins/2.7/__builtin__.pyi b/builtins/2.7/__builtin__.pyi index 7c5280c2e..e34aa90d6 100644 --- a/builtins/2.7/__builtin__.pyi +++ b/builtins/2.7/__builtin__.pyi @@ -725,6 +725,11 @@ def __import__(name: unicode, def globals() -> Dict[str, Any]: ... def locals() -> Dict[str, Any]: ... +# Actually the type of Ellipsis is , 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 = '' diff --git a/builtins/3/builtins.pyi b/builtins/3/builtins.pyi index 838d7209b..58043f712 100644 --- a/builtins/3/builtins.pyi +++ b/builtins/3/builtins.pyi @@ -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 , but since it's +# not exposed anywhere under that name, we make it private here. +class _ellipsis: ... +Ellipsis = ... # type: _ellipsis # Exceptions