docs/limitations/comprehensions.md
Monty inlines list, set, and dict comprehensions into the surrounding code object. The user-visible behaviour follows PEP 709: inlined comprehensions, no synthetic frame in tracebacks, comprehension targets do not leak into the enclosing scope.
locals() while a comprehension is running. CPython exposes the
comprehension's active targets in locals() during the comprehension body.
Monty does not implement locals() introspection.(x for x in iterable) parses but currently
materialises to a list rather than a lazy iterator.for clauses. Monty caps a single comprehension at
255 for clauses; exceeding this raises
SyntaxError: comprehension has too many nested clauses (N); maximum is 255. Per-clause operand-stack
growth means real comprehensions hit a tighter
SyntaxError: comprehension target + iterator count exceeds u8 depth operand well before that point.
CPython has no equivalent compile-time limit. The cap bounds compiler
recursion depth on attacker-controlled source.