Skip to content

Python: Add support for PEP 810#21694

Draft
tausbn wants to merge 6 commits intomainfrom
tausbn/python-add-support-for-pep-810
Draft

Python: Add support for PEP 810#21694
tausbn wants to merge 6 commits intomainfrom
tausbn/python-add-support-for-pep-810

Conversation

@tausbn
Copy link
Copy Markdown
Contributor

@tausbn tausbn commented Apr 10, 2026

Said PEP adds support for annotating imports (import ... and from ... import ...) with a lazy keyword, the semantics of which are not relevant to this PR.

We handle this in the parser in much the same way we do async currently -- import nodes get a new is_lazy field that gets populated when the lazy keyword is present. On the QL side, this determines whether the new isLazy predicate method holds on the relevant nodes.

tausbn added 6 commits April 10, 2026 13:50
As defined in PEP-810. We implement this in much the same way as how we
handle `async` annotations currently. The relevant nodes get an
`is_lazy` field that defaults to being false.
Otherwise these will disappear every time we regenerate the AST.
Adds a new `isLazy` predicate to the relevant classes, and adds the
relevant dbscheme (and up/downgrade) changes. On upgrades we do nothing,
and on downgrades we remove the `is_lazy` bits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant