-
-
Notifications
You must be signed in to change notification settings - Fork 126
Release v1.4.1 [Ernest Scribbler] #512
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
Merged
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
Signed-off-by: eindiran <eindiran@uchicago.edu>
Signed-off-by: eindiran <eindiran@uchicago.edu>
Signed-off-by: eindiran <eindiran@uchicago.edu>
Signed-off-by: eindiran <eindiran@promptu.com>
# This is the 1st commit message: Reword intro; more on LHS on being evaled Signed-off-by: eindiran <eindiran@promptu.com> # This is the commit message #2: Fix left<->right typo; minor wording improvements Signed-off-by: eindiran <eindiran@promptu.com>
The added implementation XORs the `tuple.__hash__` of the data object with the hash of the class. This should help to avoid collisions between instances of different data types with identical members. Also added a test which ensures that: * hash of a data type instance can be computed; * hashes of instances of different data types with same data differ; * hash of a data type instance differs from hash of a plain tuple. Fixes #446.
This change covers the cases like: def f(x) = return x or def f(x) = return x These previously used to raise CoconutParseErrors, and this was not obvious what should be done to fix the code. With this change the errors are raised with a meaningful error message. Fixes #354.
The test previously failed because IPyKernel.do_execute had become a coroutine, which the test did not expect. Now, if a Future is returned, it is unwrapped, otherwise (for compatibility with older versions) the return value is left as-is. Fixes #457.
This change introduces a context stack with MatchError subclasses that pattern-matching functions must raise instead of plain MatchError. This works the following way: * Every time a function is decorated with @addpattern, a subclass of MatchError is created and stored in the local scope; * when such function is called, this subclass is put on the stack before execution of addpattern's base_func; * when a pattern-matching function is called, it checks whether the exception class at the top of the stack has been already taken; * if it wasn't, the function marks it as taken (so that no other function would take it from the stack) and will raise it instead of plain MatchError; * inside addpattern, this specific exception is caught instead of MatchError. As a result, any pattern-matching function called directly as addpattern's base_func will raise a specific subclass of MatchError but will not propagate it to any pattern-matching functions called inside. The only case when addpattern will still catch a MatchError incorrectly is when addpattern wraps a non-pattern-matching function which calls a pattern-matching function internally (because the non-pattern-matching function will not mark the exception on the context stack as taken), but this should be extremely rare because addpattern is meant only for pattern-matching functions. This is an alternative implementation of PR #435.
Resolves #401.
Resolves #468.
Resolves #465.
Resolves #511.
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.
See Coconut's documentation for more information on all of the features listed below.
New features:
addpattern def
shorthand syntax (thanks @MichalMarsalek for the issue!)|**>
kwargs pipes (thanks @ArneBachmann for the issue!)(assert)
operator function (thanks @arnauorriols for the issue!)fmap
now works on numpy arrays (thanks @hoishing for the issue!)data
definitions (thanks @arnauorriols for the issue!)--target 3.8
(thanks @terrdavis for the issue!)data
types are now hashable (thanks @m-burst for the PR!)addpattern
,recursive_iterator
, and TCO'd functions are now pickleable__coconut__.py
files are created when compiling in--package
modePlus lots and lots of bugfixes!