Skip to content

Commit

Permalink
Fix a documentation error (issubtype instead of issubclass) (#12552)
Browse files Browse the repository at this point in the history
  • Loading branch information
geryogam committed Apr 8, 2022
1 parent 92b1f56 commit 588545f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/type_narrowing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 588545f

Please sign in to comment.