demopackage
A test package with a sub-package at demopackage.subpackage
.
1"""A test package with a sub-package at `.subpackage`.""" 2 3import demopackage2 4 5from . import _child_e 6from . import child_b 7from ._child_d import Test 8from .child_b import B 9from .child_c import C 10 11if demopackage2: 12 pass 13 14__all__ = [ 15 "Test", 16 "B", 17 "C", 18 "child_b", 19 "child_c", 20 "demopackage2", 21 "_child_e", 22 "child_excluded", 23 "subpackage", 24]
class
Test:
The Test class from _child_d.
class
B:
9class B: 10 """This class is defined in .child_b. It has a B.b method.""" 11 12 b_type: typing.Type[B] 13 """we have a self-referential attribute here""" 14 15 def b(self): 16 return 1
This class is defined in demopackage.child_b. It has a B.b method.
7class C(child_b.B): 8 """This class is defined in .child_c and inherits from .child_b.B""" 9 10 def c(self): 11 return 2
This class is defined in demopackage.child_c and inherits from B