Tags: Technologicat/unpythonic
Tags
Version 0.14.1 "Retrofuturistic edition" **Language version**: - Support Python 3.6. First released in 2016, supported until 2021, most distros should have it by now. - This will be the final release that supports Python 3.4; upstream support for 3.4 ended in March 2019. **New**: - ``Popper``, a pop-while iterator. - ``window``, a length-n sliding window iterator for general iterables. - ``autoref[]`` can now be nested. - ``dbg[]`` now supports also an expression variant, customizable by lexically assigning ``dbgprint_expr``. See the README on macros for details. **Bugfixes**: - Fix crash when SymPy or mpmath are not installed. - ``mogrify`` is now part of the public API, as it should have been all along. - Docs: Mention the ``mg`` function in the README. **Non-breaking changes**: - Future-proof ``namelambda`` for Python 3.8. - Docs: ``dbg[]`` is now listed as a convenience feature in the README.
**Bugfixes**: - ``setup.py``: macros are not zip safe, because ``ZipImporter`` fails to return source code for the module and MacroPy needs that. - fix splicing in the ``do[]`` macro; ``ExpandedDoView`` should now work correctly - fix lambda handling in the ``lazify`` macro - fix ``dict_items`` handling in ``mogrify`` (fixes the use of the ``curry`` macro with code using ``frozendict``) **New**: - ``roview``: a read-only view into a sequence. Behaves mostly the same as ``view``, but has no ``__setitem__`` or ``reverse``. - ``mg``: a decorator to mathify a gfunc, so that it will ``m()`` the generator instances it makes. - The ``do[]`` macro now supports ``delete[name]`` to delete a local variable previously created in the same do-expression using ``local[name << value]``. - ``envify`` block macro, to make formal parameters live in an unpythonic ``env``. - ``autoref`` block macro, to implicitly reference attributes of an object (for reading only). **Breaking changes**: - The ``macropy3`` bootstrapper now takes the ``-m`` option; ``macropy3 -m somemod``, like ``python3 -m somemod``. The alternative is to specify a filename positionally; ``macropy3 somescript.py``, like ``python3 somescript.py``. In either case, the bootstrapper will import the module in a special mode that pretends its ``__name__ == '__main__'``, to allow using the pythonic conditional main idiom also in macro-enabled code. - The constructor of the writable ``view`` now checks that the input is not read-only (``roview``, or a ``Sequence`` that is not also a ``MutableSequence``) before allowing creation of the writable view. - ``env`` now checks finalization status also when deleting attrs (a finalized ``env`` cannot add or delete bindings) **Non-breaking improvements**: - ``env`` now provides also the ``collections.abc.MutableMapping`` API. - The ``tco`` macro now skips nested ``continuations`` blocks (to allow [Lispython](https://github.com/Technologicat/pydialect/tree/master/lispython) in [Pydialect](https://github.com/Technologicat/pydialect) to support ``continuations``). - ``setup.py`` now installs the ``macropy3`` bootstrapper.
PreviousNext