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 10from .child_f import F 11from .subpackage import G 12 13if demopackage2: 14 pass 15 16__all__ = [ 17 "Test", 18 "B", 19 "C", 20 "child_b", 21 "child_c", 22 "child_f", 23 "demopackage2", 24 "_child_e", 25 "child_excluded", 26 "subpackage", 27 "F", 28 "G", 29]
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 .child_b.B.
class
F:
7class F: 8 """ 9 This class defined in .child_f links to subpackage's G which is re-exposed as `G` directly in demopackage. 10 11 We want to make sure that these links render: 12 13 - demopackage.G 14 - demopackage.subpackage.G 15 - demopackage.subpackage.child_g.G 16 """ 17 18 def g(self) -> subpackage.G: 19 return subpackage.G() 20 21 G = subpackage.G
This class defined in demopackage.child_f links to subpackage's G which is re-exposed as G
directly in demopackage.
We want to make sure that these links render:
class
F.G:
5class G: 6 """This class is defined in subpackage's child_g, but reexposed in the `demopackage.subpackage` namespace.""" 7 8 def g(self): 9 pass
This class is defined in subpackage's child_g, but reexposed in the demopackage.subpackage
namespace.
class
G:
5class G: 6 """This class is defined in subpackage's child_g, but reexposed in the `demopackage.subpackage` namespace.""" 7 8 def g(self): 9 pass
This class is defined in subpackage's child_g, but reexposed in the demopackage.subpackage
namespace.