Skip to content

0.1.1

Choose a tag to compare

@astral-releases-bot astral-releases-bot released this 29 Sep 16:17
Immutable release. Only release title and notes can be modified.
9e938ec

Released on 2026-09-29.

Serc 0.1.1 adds Python optimization modes and hash-based bytecode caches,
improves compilation performance, and expands compatibility with CPython.

Enhancements

  • Compile with Python’s -O and -OO optimization modes through CLI flags or
    CompileOptions (#841;
    #841)
  • Generate checked or unchecked hash-based bytecode caches with
    --invalidation-mode or CompiledModule::to_hash_pyc (#840;
    #840)
  • Opt into caller-selected decimal literal parsing limits through new text,
    byte, and path compilation APIs (#911;
    #911)
  • Model the caller’s integer-to-string limit when formatting duplicate
    mapping-key diagnostics through opt-in compilation APIs (#887;
    #887)
  • Reproduce floating-point constant folding from documented CPython 3.14.5 GCC
    and Clang builds on supported GNU/Linux x86-64 hosts by selecting a native
    build profile (#824; #824)

Bug fixes

  • Produce CPython-compatible control flow, source locations, exception tables,
    and constant sharing under -O and -OO (#912;
    #912)
  • Preserve requested .opt-N.pyc cache suffixes for repeated optimization flags
    while applying -OO semantics (#912;
    #912)
  • Compile nested continue statements in finally suites without negative
    stack-depth errors or incorrect exception restoration (#825;
    #825)
  • Compile deeply nested expressions and postponed annotations without
    overflowing the compiler stack (#827;
    #827)
  • Honor selected native build profiles throughout nested constant folding
    (#827; #827)
  • Keep enclosing cleanup and exception handlers active when tracing raises at a
    nested no-op finally suite (#900;
    #900) (#908;
    #908)
  • Convert StopIteration raised by tracing in nested generator finalizers into
    RuntimeError instead of silently terminating the generator
    (#903; #903)
  • Resolve private type-parameter names and their mangled aliases to the same
    binding in generic class headers (#828;
    #828)
  • Preserve marshal object identity for retained native startup names on Python
    3.14 (#830; #830)
  • Remove redundant NOP instructions before module annotations after literal
    and negated conditions on Python 3.14 and 3.15 (#894;
    #894) (#906;
    #906)
  • Match CPython opcode ordering when breaking from an exceptional finally
    suite into nested handler cleanup (#829;
    #829)
  • Preserve async-comprehension assertion exits in terminal conditionals on
    Python 3.12 (#889; #889)
  • Match CPython’s exception-table coverage for markers in nested finalizers
    after a handler returns (#904;
    #904)
  • Match CPython bytecode and exception-table ownership after branching try
    bodies enter nested finalizers (#909;
    #909)
  • Match CPython 3.12 source locations for successful assertions at the end of
    finally suites (#907;
    #907)
  • Reject lambdas and comprehensions in Python 3.12 generic headers when their
    annotation scopes can see an enclosing class namespace (#831;
    #831)
  • Reject repeated explicit keyword arguments in calls, including unreachable
    code (#845; #845)
  • Reject invalid uses of __debug__ in attributes, call and class keywords, and
    class patterns according to the target Python version (#847;
    #847)
  • Reject commas immediately following bare yield expressions while continuing
    to accept parenthesized yields and yield tuples (#846;
    #846)
  • Reject Python sources with more than 99 active indentation levels
    (#834; #834)
  • Enforce CPython’s default 4,300-digit limit for decimal integer literals
    (#835; #835)
  • Reject parameter specification and variadic type-parameter defaults when
    targeting Python 3.12 (#869;
    #869) (#870;
    #870)
  • Include the repeated type-parameter name in duplicate-name diagnostics
    (#850; #850)
  • Match CPython diagnostics for unknown __future__ features
    (#858; #858)
  • Match CPython diagnostics for misplaced __future__ imports
    (#860; #860)
  • Prioritize misplaced __future__ imports over unknown features in the same
    statement (#865; #865)
  • Match CPython diagnostics and source ranges for duplicate mapping-pattern keys
    (#857; #857)
  • Reject large integer mapping-pattern keys that compare equal to floating-point
    or complex keys (#861;
    #861)
  • Preserve lone surrogates when validating and folding mapping-pattern keys
    (#877; #877)
  • Match CPython diagnostics for assignment expressions targeting attributes
    (#871; #871)
  • Match CPython diagnostics for unparenthesized tuples after yield from
    (#872; #872)
  • Preserve type-alias default diagnostics when later syntax errors are also
    present (#867; #867)
  • Report the appropriate comprehension-specific error for yield and
    yield from expressions inside comprehensions (#879;
    #879)
  • Report direct dictionary-comprehension value yield errors before
    corresponding key errors (#880;
    #880)
  • Report nested comprehension yield errors in operand order
    (#884; #884)
  • Prioritize comprehension yield errors over earlier bare starred expressions
    (#885; #885)
  • Prioritize supported comprehension yield errors over async-generator
    value-return errors (#895;
    #895)
  • Match CPython diagnostics for await inside synchronous functions and lambdas
    (#896; #896)
  • Resolve invalid global and nonlocal declarations before reporting
    mapping-pattern errors (#881;
    #881)

Performance

  • Reduce compilation overhead across scope analysis, source handling, assembler
    passes, and marshal serialization (#848;
    #848)