Skip to content

Commit 588545f

Browse files
authored
Fix a documentation error (issubtype instead of issubclass) (python#12552)
1 parent 92b1f56 commit 588545f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/source/type_narrowing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ for better type inference when working with types and metaclasses:
100100
t = type(o) # We must use a variable here
101101
reveal_type(t) # Revealed type is "builtins.type"
102102
103-
if issubtype(t, MyCalcMeta): # `issubtype(type(o), MyCalcMeta)` won't work
103+
if issubclass(t, MyCalcMeta): # `issubclass(type(o), MyCalcMeta)` won't work
104104
reveal_type(t) # Revealed type is "Type[MyCalcMeta]"
105105
t.calc() # Okay
106106

0 commit comments

Comments
 (0)