Using doctest with NumbaΒΆ

Numba allows numba functions decorated with jit or autojit to participate in doctest modules. Instead of using the doctest module, one has to use numba.testmod instead:

import numba

@numba.autojit
def func(value):
    """
    >>> func(10.0)
    10.0
    """
    return value

numba.testmod()

Previous topic

Static Compilation of Numba Functions

Next topic

Examples

This Page