Skip to content

Commit

Permalink
Fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub committed Aug 21, 2024
1 parent b17742d commit c4b8016
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,7 @@ main_func(

### Anonymous Namedtuples

Coconut supports anonymous [`namedtuple`](https://docs.python.org/3/library/collections.html#collections.namedtuple) literals, such that `(a=1, b=2)` can be used just as `(1, 2)`, but with added names. Anonymous `namedtuple`s are always pickleable.
Coconut supports anonymous [`namedtuple`](https://docs.python.org/3/library/collections.html#collections.namedtuple) literals, such that `(a=1, b=2)` can be used just as `(1, 2)`, but with added names. Anonymous `namedtuple`s are always pickleable and support [`__match_args__`](https://peps.python.org/pep-0622/) on all Python versions.

The syntax for anonymous namedtuple literals is:
```coconut
Expand Down
6 changes: 3 additions & 3 deletions coconut/command/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ class Prompt(object):
style = None
runner = None
lexer = None
suggester = None if prompt_use_suggester else False
suggester = True if prompt_use_suggester else None

def __init__(self, setup_now=False):
"""Set up the prompt."""
Expand All @@ -686,7 +686,7 @@ def setup(self):
We do this lazily since it's expensive."""
if self.lexer is None:
self.lexer = PygmentsLexer(CoconutLexer)
if self.suggester is None:
if self.suggester is True:
self.suggester = AutoSuggestFromHistory()

def set_style(self, style):
Expand Down Expand Up @@ -760,7 +760,7 @@ def prompt(self, msg):
pygments.styles.get_style_by_name(self.style),
),
completer=self.get_completer(),
auto_suggest=self.suggester or None,
auto_suggest=self.suggester,
)


Expand Down
2 changes: 1 addition & 1 deletion coconut/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
VERSION = "3.1.1"
VERSION_NAME = None
# False for release, int >= 1 for develop
DEVELOP = 4
DEVELOP = 5
ALPHA = False # for pre releases rather than post releases

assert DEVELOP is False or DEVELOP >= 1, "DEVELOP must be False or an int >= 1"
Expand Down
2 changes: 1 addition & 1 deletion coconut/tests/src/cocotest/agnostic/main.coco
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def package_test(outer_MatchError) -> bool:
assert MatchError() `isinstance` outer_MatchError, (MatchError, outer_MatchError)
assert outer_MatchError() `isinstance` MatchError, (outer_MatchError, MatchError)
assert_raises((raise)$(outer_MatchError), MatchError)
assert_raises((raise)$(MatchError), outer_MatchError)
assert_raises((raise)$(MatchError), outer_MatchError) # type: ignore
def raises_outer_MatchError(obj=None):
raise outer_MatchError("raises_outer_MatchError")
match raises_outer_MatchError -> None in 10:
Expand Down

0 comments on commit c4b8016

Please sign in to comment.