Feature or enhancement
Proposal:
Goal
Allow lazy to be coloured by IDEs and syntax highlighters exactly like import and from when it appears in an import statement.
Example
lazy import math
lazy import numpy as np
(and lazy should be red as well)
Why
lazy is already used as a special marker in some lazy‑import implementations (e.g., custom import hacks, or PyPy's lazy loading).
Making it a proper keyword token in the grammar (or at least a pseudo‑keyword inside import context) would let editors colour it consistently, improving readability.
Implementation idea
Extend the lexer to treat lazy as a keyword only when it follows import or from ... import. This avoids breaking existing code that uses lazy as a variable name elsewhere.
Benefit for developers
Immediate visual cue that an import is deferred / lazy.
No need for special comments or pragmas to trigger highlighting.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Feature or enhancement
Proposal:
Goal
Allow
lazyto be coloured by IDEs and syntax highlighters exactly like import and from when it appears in an import statement.Example
(and
lazyshould be red as well)Why
lazyis already used as a special marker in some lazy‑import implementations (e.g., custom import hacks, or PyPy's lazy loading).Making it a proper keyword token in the grammar (or at least a pseudo‑keyword inside import context) would let editors colour it consistently, improving readability.
Implementation idea
Extend the lexer to treat
lazyas a keyword only when it followsimportorfrom ... import. This avoids breaking existing code that uses lazy as a variable name elsewhere.Benefit for developers
Immediate visual cue that an import is deferred / lazy.
No need for special comments or pragmas to trigger highlighting.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response