From 588545f501ab4542cc2e70c64f2630b2786c1dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Ogam?= Date: Fri, 8 Apr 2022 18:25:49 +0200 Subject: [PATCH] Fix a documentation error (issubtype instead of issubclass) (#12552) --- docs/source/type_narrowing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/type_narrowing.rst b/docs/source/type_narrowing.rst index b5f297d283c0..806835ed33a5 100644 --- a/docs/source/type_narrowing.rst +++ b/docs/source/type_narrowing.rst @@ -100,7 +100,7 @@ for better type inference when working with types and metaclasses: t = type(o) # We must use a variable here reveal_type(t) # Revealed type is "builtins.type" - if issubtype(t, MyCalcMeta): # `issubtype(type(o), MyCalcMeta)` won't work + if issubclass(t, MyCalcMeta): # `issubclass(type(o), MyCalcMeta)` won't work reveal_type(t) # Revealed type is "Type[MyCalcMeta]" t.calc() # Okay