Unpythonic

Latest version: v0.15.3

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 7

0.10.0

- Add more macros, notably ``continuations``, ``tco``, ``autoreturn``
- Polish macros, especially their interaction
- Remove old exception-based TCO, rename ``fasttco`` to ``tco``

---

0.9.2

- new `multilambda` block macro: supercharge regular Python lambdas, contained lexically inside the block, with support for multiple expressions and local variables. Use brackets to denote a multi-expression body.
- new `fup` macro providing more natural syntax for functional updates; allows using slice syntax.
- upgrade: the `let` macros can now optionally have a multi-expression body. To enable, wrap the body in an extra set of brackets.
- remove the 0.9.0 multilambda `λ`; brittle and was missing features.

The macros implement the multi-expression bodies by inserting a `do`; this introduces an internal-definition context for local variables. See its documentation in the macro_extras README for usage.

The macro_extras README now includes a table of contents for easy browsability.

---

0.9.0

- **Macros!** New module `unpythonic.syntax`, adding syntactic macros for constructs where this improves usability. See [`macro_extras`](macro_extras/) for documentation.
- Notable macros include `curry` (automatic currying for Python) and `cond` (multi-branch conditional expression, usable in a lambda), and macro variants of the `let` constructs (no boilerplate).
- As of this writing, requires the [latest MacroPy3](https://github.com/azazel75/macropy) from git HEAD.
- Not loaded by default. To use, `from unpythonic.syntax import macros, ...`.
- Include generic MacroPy3 bootstrapper for convenience, to run macro-enabled Python programs.
- Fix bug in let constructs: should require unique names in the same `let`/`letrec`.
- Fix bug in `unpythonic.fun.apply`.

---

0.8.8

Changes:

- ``curry``: by default, ``TypeError`` if args remaining when exiting top-level curry context
- add dynvar ``curry_toplevel_passthrough`` to switch the error off
- ``rotate`` now conceptually shifts the arg slots, not the values; this variant seems easier to reason about.
- accept just tuple (not list) as the pythonic multiple-return-values thing in ``curry``, ``compose``, ``pipe``

New:

- add ``make_dynvar``, to set a default value for a dynamic variable. Eliminates the need for ``if 'x' in dyn`` checks.
- as an optional extra, add a [MacroPy3](https://github.com/azazel75/macropy) based autocurry macro, which automatically curries all function calls that lexically reside in a ``with curry`` block. (Make your Python look somewhat like Haskell.)

Bugfixes/optimizations:

- ``nth``: fix off-by-one bug
- ``dyn``: skip pushing/popping a scope if no bindings given

---

0.8.7

Changes:

- `scanr` now syncs the left ends of multiple inputs, as it should.
- robustness: add a typecheck to `ShadowedSequence.__init__`
- rename: for consistency with `rscanl`, `rfoldl`, the new names of *sync right ends of multiple inputs, then map/zip from the right*, are `rmap`, `rzip`.
- `llist`, `lreverse` are now more ducky/pythonic.

New:

- add `rscanl`, `rscanl1`, `rfoldl`, `rreducel`: reverse each input, then left-scan/left-fold. This approach syncs the right ends if multiple inputs.
- add `mapr`, `zipr` (map-then-reverse): sync left ends of multiple inputs, then map/zip from the right.
- add convenience function `rev`: try `reversed(...)`, if `TypeError` then `reversed(tuple(...))`
- add `butlast`, `butlastn`, `partition`

---

0.8.6

New features:

- add `unfold`, `unfold1`: generate a sequence corecursively
- add memoization for iterables (`imemoize`, `fimemoize`)

Enhancements:

- `call` now accepts also args (see docstring)
- gtco: allow tail-chaining into any iterable
- document new features in README (also those from 0.8.5)

Bugfixes:

- fix bugs in gtco
- strip trampolines correctly in nested generator-TCO chains
- fix handling of generator return values

---

Page 4 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.