Skip to content

Require async/await usage in templates #1191

@pgjones

Description

@pgjones

The current async mode happily allows coroutines to be awaited without requiring the await keyword. Whilst this is nice, it is actually quite a confusing and a non-obvious behavior. In addition it doesn't always work, for example {% if coroutine %}, and I'm not sure {% async for ... or {% async with ... work. (Edit: The if statement does work, I'm unsure about async for or async with)

I propose that templating engine understand and require the usage of the async and await keywords dropping the current support for non awaited coroutines.

It would also be nice if the engine did not use any asyncio features so as to be event loop agnostic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions