From bb33cb0119c329e382f1c51fbcd27de5f58bd679 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Sun, 29 Jan 2017 22:17:01 +0300 Subject: [PATCH] Added __instancecheck__ and __subclasscheck__ to type (#887) --- stdlib/2/__builtin__.pyi | 2 ++ stdlib/3/builtins.pyi | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 2d8da1561..59b01e58a 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -68,6 +68,8 @@ class type(object): # implementation seems to be returning a list. def mro(self) -> List[type]: ... def __subclasses__(self: _TT) -> List[_TT]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... class int(SupportsInt, SupportsFloat, SupportsAbs[int]): @overload diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 2c1200dfa..952cb3dec 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -72,6 +72,8 @@ class type: # Note: the documentation doesnt specify what the return type is, the standard # implementation seems to be returning a list. def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... class super(object): @overload