# Path: paco/assertions.py
# def assert_corofunction(**kw):
#     """
#     Asserts if a given values are a coroutine function.
# 
#     Arguments:
#         **kw (mixed): value to check if it is an iterable.
# 
#     Raises:
#         TypeError: if assertion fails.
#     """
#     for name, value in kw.items():
#         if not asyncio.iscoroutinefunction(value):
#             raise TypeError(
#                 'paco: {} must be a coroutine function'.format(name))


import asyncio
from .assertions import assert_corofunction
    """
    A thunk is a subroutine that is created, often automatically, to assist
    a call to another subroutine.

    Creates a thunk coroutine which returns coroutine function that accepts no
    arguments and when invoked it schedules the wrapper coroutine and
    returns the final result.

    See Wikipedia page for more information about Thunk subroutines:
    https://en.wikipedia.org/wiki/Thunk

    Arguments:
        value (coroutinefunction): wrapped coroutine function to invoke.

    Returns:
        coroutinefunction

    Usage::

        async def task():
            return 'foo'

        coro = paco.thunk(task)

        await coro()
        # => 'foo'
        await coro()
        # => 'foo'

    """

# Path: paco/assertions.py
# def assert_corofunction(**kw):
#     """
#     Asserts if a given values are a coroutine function.
# 
#     Arguments:
#         **kw (mixed): value to check if it is an iterable.
# 
#     Raises:
#         TypeError: if assertion fails.
#     """
#     for name, value in kw.items():
#         if not asyncio.iscoroutinefunction(value):
#             raise TypeError(
#                 'paco: {} must be a coroutine function'.format(name))


# Path: paco/thunk.py
import asyncio
from .assertions import assert_corofunction

    """
    A thunk is a subroutine that is created, often automatically, to assist
    a call to another subroutine.

    Creates a thunk coroutine which returns coroutine function that accepts no
    arguments and when invoked it schedules the wrapper coroutine and
    returns the final result.

    See Wikipedia page for more information about Thunk subroutines:
    https://en.wikipedia.org/wiki/Thunk

    Arguments:
        value (coroutinefunction): wrapped coroutine function to invoke.

    Returns:
        coroutinefunction

    Usage::

        async def task():
            return 'foo'

        coro = paco.thunk(task)

        await coro()
        # => 'foo'
        await coro()
        # => 'foo'

    """

    assert_corofunction(coro=coro)