from typing import Callable
from typing import Any


def test_lambda_function_object() -> None:
    """Lambda returned by a function."""

    def power(base: int) -> Callable[[int], Any]:
        """Lambda expression to calculate power."""
        # Power (** and pow()) return type is Any
        # See https://github.com/python/typeshed/issues/285
        return lambda exponent: base ** exponent

    two_raised_to_the_power_of = power(2)
    assert two_raised_to_the_power_of(3) == 8