Edit on GitHub

demo

A small pdoc example.

View Source
"""
A small `pdoc` example.
"""

class Dog:
    """🐕"""
    name: str
    """The name of our dog."""
    friends: list["Dog"]
    """The friends of our dog."""

    def __init__(self, name: str):
        """Make a Dog without any friends (yet)."""
        self.name = name
        self.friends = []

    def bark(self, loud: bool = True):
        """*woof*"""
#   class Dog:
View Source
class Dog:
    """🐕"""
    name: str
    """The name of our dog."""
    friends: list["Dog"]
    """The friends of our dog."""

    def __init__(self, name: str):
        """Make a Dog without any friends (yet)."""
        self.name = name
        self.friends = []

    def bark(self, loud: bool = True):
        """*woof*"""

🐕

#   Dog(name: str)
View Source
    def __init__(self, name: str):
        """Make a Dog without any friends (yet)."""
        self.name = name
        self.friends = []

Make a Dog without any friends (yet).

#   name: str

The name of our dog.

#   friends: list[demo.Dog]

The friends of our dog.

#   def bark(self, loud: bool = True):
View Source
    def bark(self, loud: bool = True):
        """*woof*"""

woof