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:
5class Test:
6    """The Test class from _child_d."""
7
8    def foo(self, a: int):
9        """Do foo."""

The Test class from _child_d.

def foo(self, a: int):
8    def foo(self, a: int):
9        """Do foo."""

Do foo.

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.

b_type: Type[B]

we have a self-referential attribute here

def b(self):
15    def b(self):
16        return 1
class C(demopackage.B):
 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

def c(self):
10    def c(self):
11        return 2
Inherited Members
B
b_type
b