Coconut v3.0.0
Coconut v3! See Coconut's documentation for more information on all of the features listed below.
Note that v3 is a major version release that comes with some breaking changes, though Coconut will do its best to warn you if your code does anything that changed from v2 to v3.
Breaking changes:
- #714:
setpatterns now work likedictpatterns where they allow extra keys, such that{1, 2}will match{1, 2, 3}. To get back the strict behavior, use the{1, 2, 3, *()}pattern. Coconut will warn you if your code contains set patterns without an explicit strictness marker. - #707: the precedence of implicit function application has been changed to be compatible with implicit coefficients, such that
f x**2is now equivalent tof(x**2)rather thanf(x)**2. Coconut will warn you if your code contains expressions with new precedence. - #733:
.$[]will now only default to using an existing__getitem__if the object is registered as acollections.abc.Sequence.__iter_getitem__will still always be used. Lets you do things like{"k": "v"}$[0]. - #730:
obj.syntax as a shorthand forgetattr$(obj)deprecated. - #732:
--jobsnow defaults tosysrather than0.
New features:
- #707: New implicit coefficient syntax! Polynomials are just
a x**2 + b x + c, with support for single variable names and numeric constants as coefficients. - #731: New
copyclosure deffunctions that copy their closures on function creation, allowing them to e.g. hold on to loop variables. - #709:
(+)syntax in a typing context now yields atyping.Protocolthat requires supporting that operator. - #709: New
&:operator for combining multipletyping.Protocol's into a single protocol. - #718 (thanks @yggdr!): You can now use
addpattern defeven if there's no existing function of that name, allowing you to useaddpattern deffor every pattern rather than having to usematch deffor the first one. - #727: New
x |> awaitsyntax for usingawaitin pipes. - #734: Substantially improved
pandassupport. - #714: New
frozensetandmultisetpatterns.
Bugfixes:
- #725 (thanks @yggdr!): Fixed
(in)operator function argument ordering. - #721 (thanks @yggdr!):
is notandnot inoperator functions now supported. - #724 (thanks @Starwort!): Coconut no longer slows down
xonshloading and fixedxontrib unload coconut. - #726 (thanks @caedmon-kitty!): Fixed certain
xonshcommands when using Coconut'sxonshplugin. - #723:
dictnow always functions as on the latest Python 3 on any Python version. - #728 (thanks @yggdr!): Fixed
supercompatibility across Python versions and some cases wheresuper()wouldn't work. - #717 (thanks @kksgandhi!): Fixed
coconut --jupyter qtconsole.