def my_func():
another_func(lambda: ...)
you can write def my_func():
def inner(): ...
another_func(inner)
Sure, it's creating a function, naming it, then immediately throwing it away, but gets the job done with minimal extra boilerplate.