MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / subclasses

Function subclasses

17-it-generator/tree/classtree/classtree.py:14–18  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

12
13
14def subclasses(cls):
15 try:
16 return cls.__subclasses__()
17 except TypeError: # handle the `type` type
18 return cls.__subclasses__(cls)
19
20
21def tree(cls, level=0, last_sibling=True):

Callers 3

test_subclassesFunction · 0.90
test_subclasses_of_typeFunction · 0.90
treeFunction · 0.70

Calls

no outgoing calls

Tested by 2

test_subclassesFunction · 0.72
test_subclasses_of_typeFunction · 0.72