Skip to content

mkdocs_demo.config.interfaces

This module contains interfaces and custom types.

ITrolling

ITrolling(x: float, n: int)

Abstract base class for implementing trolling interface.

Parameters

x : float The parameter x is a float, which means it can hold decimal values. It is used to store a numerical value.

n : int The parameter n is an integer that represents the number of iterations or steps in a process.

Source code in src/mkdocs_demo/config/interfaces.py
def __init__(self, x: float, n: int) -> None:
    """
    The above function is an initializer method for a class that takes in
    two parameters, `x` and `n`, and does not return anything.

    Parameters
    ----------
    `x` : `float`
        The parameter `x` is a float, which means it can hold decimal
        values. It is used to store a numerical value.

    `n` : `int`
        The parameter `n` is an integer that represents the number of
        iterations or steps in a process.
    """

    self.x = x
    self.n = n

n instance-attribute

n = n

x instance-attribute

x = x

__repr__

__repr__() -> str
Source code in src/mkdocs_demo/config/interfaces.py
def __repr__(self) -> str:
    return f"""{self.x} * {self.n} = {self.multiple}"""

__str__

__str__() -> str
Source code in src/mkdocs_demo/config/interfaces.py
def __str__(self) -> str:
    return f"""x={self.x}, n={self.n}, hence the multiple={self.multiple}"""

from_dict abstractmethod

from_dict(d: dict[str, int]) -> Self
Source code in src/mkdocs_demo/config/interfaces.py
@abstractmethod
def from_dict(cls, d: dict[str, int]) -> Self:
    pass

multiple abstractmethod

multiple() -> float
Source code in src/mkdocs_demo/config/interfaces.py
@abstractproperty
@abstractmethod
def multiple(self) -> float:
    pass

Language

Bases: Enum

Enum that represents different programming languages.

BASH class-attribute instance-attribute

BASH: str = '*.sh'

Bash language.

PYTHON class-attribute instance-attribute

PYTHON: str = '*.py'

Python language.