demopackage API documentation

# demopackage

A test package with a sub-package at `demopackage.subpackage`.

View Source

     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: View Source

    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): View Source

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

Do foo.

class B: View Source

     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): View Source

    15    def b(self):
    16        return 1

class C(demopackage.B): View Source

     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.

def c(self): View Source

    10    def c(self):
    11        return 2

##### Inherited Members

B
  b_type
  b

class F: View Source

     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:

- demopackage.G
- demopackage.subpackage.G
- demopackage.subpackage.child_g.G

def g(self) -> G: View Source

    18    def g(self) -> subpackage.G:
    19        return subpackage.G()

class F.G: View Source

    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: View Source

    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.

def g(self): View Source

    8    def g(self):
    9        pass