Skip to content

_c_extension.pyi Reference

Foo

Source code in simple_python_template/_c_extension.pyi
class Foo:
    def __init__(self):
        """
        Initialize the Foo instance.
        """
        pass

    def __call__(self):
        """
        Make the instance callable.

        This method allows the instance of Foo to be used as a function.
        """
        pass

    @property
    def counter(self):
        """
        Get the counter value.

        Returns
        -------
            int: The current value of the counter.
        """
        pass

counter property

Get the counter value.

Returns
int: The current value of the counter.

__call__()

Make the instance callable.

This method allows the instance of Foo to be used as a function.

Source code in simple_python_template/_c_extension.pyi
def __call__(self):
    """
    Make the instance callable.

    This method allows the instance of Foo to be used as a function.
    """
    pass

__init__()

Initialize the Foo instance.

Source code in simple_python_template/_c_extension.pyi
2
3
4
5
6
def __init__(self):
    """
    Initialize the Foo instance.
    """
    pass

add(x, y)

Add two integers.

Parameters:

Name Type Description Default
x int

The first integer.

required
y int

The second integer.

required

Returns

int: The sum of x and y.
Source code in simple_python_template/_c_extension.pyi
def add(x: int, y: int) -> int:
    """
    Add two integers.

    Args:
        x (int): The first integer.
        y (int): The second integer.

    Returns
    -------
        int: The sum of x and y.
    """
    pass

divide(x, y)

Divide one number by another.

Parameters:

Name Type Description Default
x float

The numerator.

required
y float

The denominator.

required

Returns

float: The result of the division.

Raises

ZeroDivisionError: If y is zero.
Source code in simple_python_template/_c_extension.pyi
def divide(x: float, y: float) -> float:
    """
    Divide one number by another.

    Args:
        x (float): The numerator.
        y (float): The denominator.

    Returns
    -------
        float: The result of the division.

    Raises
    ------
        ZeroDivisionError: If y is zero.
    """
    pass