Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.0.0 [How Not to Be Seen] #671

Merged
merged 494 commits into from Sep 26, 2022
Merged

Release v2.0.0 [How Not to Be Seen] #671

merged 494 commits into from Sep 26, 2022

Conversation

evhub
Copy link
Owner

@evhub evhub commented Sep 26, 2022

Coconut v2 is here! See Coconut's documentation for more information on all of the features listed below.

Breaking changes:

  • Coconut 2.0 pattern-matching changes #605: Coconut pattern-matching is now fully unified with Python 3.10 pattern-matching: pattern-matching always works the same way regardless of where it is used, always uses Python 3.10 rules, but also always supports all additional Coconut pattern-matching features. Some implications of this:
    • Coconut now fully supports class patterns everywhere, including in pattern-matching function definition and destructuring assignment.
    • As a result, x is int type-checking syntax is now deprecated in favor of using the int(x) class pattern. For cases where there is now rewriting as a class pattern, x `isinstance` int syntax is also supported.
    • Pattern-matching for dictionaries has been changed so that {"a": a} now matches a dictionary with at least "a" as a key rather than exactly "a" as its only key to be consistent with Python 3.10. Coconut will warn if such syntax is detected and suggest the explicit {"a": a, **_} or {"a": a, **{}} syntax instead.
  • data types should not add and multiply like tuples #639: Coconut data types no longer support adding or multiplying them like tuples unless explicitly added via __add__/__mul__ methods.
  • fmap over a dict should map over the items, not starmap #623: fmap over a Mapping (e.g. dict) now does a normal map instead of a starmap. Thus, you'll need to do fmap$(def ((k, v)) -> (new_k, new_v)) instead of fmap$((k, v) -> (new_k, new_v)). Old behavior can also be recovered with fmap$(starmap_over_mappings=True).
  • Add getitem and change iter_getitem operator function notations #615: ($[]) spelling for the iterator slicing operator function has been removed in favor of .$[] and the normal getitem operator has been added as .[].
  • Change precedence of function composition #613: Precedence of the function composition operator .. has been lowered such that f x .. g y is now equivalent to (f x) .. (g y) rather than ((f x) .. g) y.
  • Change initializer to initial in scan signature to match reduce #635: initializer keyword argument in scan changed to initial to match the function signature of reduce.

New language features:

New compiler features:

Bugfixes:

@evhub evhub added the release label Sep 26, 2022
@evhub evhub added this to the v2.0.0 milestone Sep 26, 2022
@evhub
Copy link
Owner Author

evhub commented Sep 26, 2022

TODO: Once Coconut v2 is released, Coconut should be added to xonsh's list of xontribs.

@evhub evhub modified the milestones: v2.0.0, v2.0.1 Sep 26, 2022
@evhub evhub merged commit a17c703 into master Sep 26, 2022
@evhub evhub added the resolved label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant