Skip to content

__bool__ method on Results #1832

@simonw

Description

@simonw

Wrote this code today: https://github.com/simonw/datasette-public/blob/1401bfae50e71c1dfd2bfb6954f2e86d5a7ab21b/datasette_public/__init__.py#L41

    results = await db.execute(
        "select 1 from _public_tables where table_name = ?", [table_name]
    )
    if len(results):
        return True

Would be nice if I could use if results there instead.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions