import asyncio


def create_future(loop):
    """Creates a Future object.

    Uses loop.create_future if it is available. Otherwise, create the object directly.

    Use of loop.create_future is preferred because it allows third parties to provide their own
    Future object, but it is only available in 3.5.2+

    :returns: A new Future object.
    """
    try:
        future = loop.create_future()
    except AttributeError:
        future = asyncio.Future(loop=loop)
    return future