Skip to content

v0.8.1

Choose a tag to compare

@github-actions github-actions released this 31 Aug 08:55
· 107 commits to main since this release
dec181b

Pyfun 0.8.1

A bugfix release. Both fixes came from a dogfooding round on a real Pyfun program (a Scrabble game
with an async spectator mode) built against 0.8.0.

Fixed

  • A module mut assigned inside async/seq/result silently bound a local instead of the
    module binding.
    Every built-in computation expression lowers its body to its own nested Python
    function (a coroutine for async, a generator for seq, and so on), but that nested function was
    missing the global/nonlocal declarations that ordinary function bodies get for captured mut
    assignments. The result: a flag flipped from inside an async { } block never actually flipped,
    with no error — the assignment just bound a fresh local that was thrown away. result {}'s
    read-modify-write form hit the louder UnboundLocalError version of the same bug. All four
    built-in CE forms now get the same capture analysis as function bodies. (#122)

  • A unit parameter did not erase consistently across an extern's parameter list. A leading
    unit before real parameters split the call in two instead of dropping
    (unit -> int -> int = abs applied to myAbs () (-5) emitted abs()(-5), calling the result of
    abs()), and a unit in the middle of a parameter list was passed through as Python None
    instead of vanishing (int -> unit -> int -> int emitted max(3, None, 5)). The rule is now one
    rule: a unit parameter contributes no argument, wherever it sits. Partial application of a
    unit-slotted extern now closes over a lambda rather than functools.partial (which cannot drop an
    argument that has not arrived yet), and the fix reaches receiver methods, kwarg-slot externs, and
    bare references the same way. (#123)

Breaking

  • An extern's mid-list unit argument no longer arrives as Python None on the other side of the
    boundary — it is dropped from the call entirely, matching how a leading/trailing unit already
    behaved. This only affects an extern binding that both declares a non-leading unit parameter and
    relies on the Python callee actually receiving None there; nothing in the standard library or
    examples depended on the old behavior.