reveal_type
is a MyPy-specific construct for debugging types and isn't part of PEP 484. You should define a reusable type alias instead.
from typing import Callable
# Define the type alias
MyCallback = Callable[[int], bool]
# Your function definitions
def stream(b: int, f: MyCallback) -> bool:
return f(b)