Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.f x**2is now equivalent tof(x**2)rather thanf(x)**2. Coconut will warn you if your code contains expressions with new precedence..$[]only use__iter_getitem__, not__getitem__#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].getattrpartials #730:obj.syntax as a shorthand forgetattr$(obj)deprecated.--jobsdefault tosysrather than0#732:--jobsnow defaults tosysrather than0.New features:
a x**2 + b x + c, with support for single variable names and numeric constants as coefficients.copyclosure deffunctions that copy their closures on function creation, allowing them to e.g. hold on to loop variables.(+)syntax in a typing context now yields atyping.Protocolthat requires supporting that operator.&:operator for combining multipletyping.Protocol's into a single protocol.addpattern defwith no priormatch def#718 (thanks @yggdr!): You can now useaddpattern 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.await#727: Newx |> awaitsyntax for usingawaitin pipes.pandassupport #734: Substantially improvedpandassupport.frozensetandmultisetpatterns.Bugfixes:
inoperator in pattern matching code #725 (thanks @yggdr!): Fixed(in)operator function argument ordering.is notandnot inoperator functions now supported.xonshloading and fixedxontrib unload coconut.xonshcommands when using Coconut'sxonshplugin.dictnow always functions as on the latest Python 3 on any Python version.supercompatibility across Python versions and some cases wheresuper()wouldn't work.coconut --jupyter qtconsole.