Skip to content

Commit 04866e5

Browse files
authored
Merge pull request #2353 from Kodiologist/release
Release Hy 0.25.0
2 parents b107100 + 4404c11 commit 04866e5

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

NEWS.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
.. default-role:: code
22

3-
Unreleased
3+
0.25.0 (released 2022-11-08)
44
==============================
55

6-
Other Breaking Changes
6+
Breaking Changes
77
------------------------------
88
* `dfor` no longer requires brackets around its final arguments, so
99
`(dfor x (range 5) [x (* 2 x)])` is now `(dfor x (range 5) x (* 2
1010
x))`.
11-
12-
New Features
13-
------------------------------
14-
* Python 3.11 is now supported.
15-
* `except*` (PEP 654) is now recognized in `try`.
11+
* `except*` (PEP 654) is now recognized in `try`, and a placeholder
12+
macro for `except*` has been added.
1613

1714
Bug Fixes
1815
------------------------------
19-
* Fixed `hy.repr` of `slice` objects with non-integer arguments.
2016
* `__file__` should now be set the same way as in Python.
17+
* `\N{…}` escape sequences are now recognized in f-strings.
2118
* Fixed a bug with `python -O` where assertions were still partly
2219
evaluated.
23-
* `\N{…}` escape sequences are now recognized in f-strings.
20+
* Fixed `hy.repr` of `slice` objects with non-integer arguments.
21+
22+
New Features
23+
------------------------------
24+
* Python 3.11 is now supported.
2425

2526
Misc. Improvements
2627
------------------------------

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,7 @@ expanded, is crash, regardless of their arguments:
14281428

14291429
- ``else``
14301430
- ``except``
1431+
- ``except*``
14311432
- ``finally``
14321433
- ``unpack-mapping``
14331434
- ``unquote``

hy/core/result_macros.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,8 @@ def compile_let(compiler, expr, root, bindings, body):
18951895

18961896

18971897
@pattern_macro(
1898-
"unquote unquote-splice unpack-mapping except finally else".split(), [many(FORM)]
1898+
"unquote unquote-splice unpack-mapping except except* finally else".split(),
1899+
[many(FORM)],
18991900
)
19001901
def compile_placeholder(compiler, expr, root, body):
19011902
raise ValueError(f"`{root}` is not allowed here")

tests/compilers/test_ast.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,14 +579,22 @@ def test_setv_builtins():
579579
)
580580

581581

582-
def test_top_level_unquote():
582+
def placeholder_macro(x, ename=None):
583583
with pytest.raises(HyLanguageError) as e:
584-
can_compile("(unquote)")
585-
assert "`unquote` is not allowed here" in e.value.msg
584+
can_compile(f"({x})")
585+
assert f"`{ename or x}` is not allowed here" in e.value.msg
586586

587-
with pytest.raises(HyLanguageError) as e:
588-
can_compile("(unquote-splice)")
589-
assert "`unquote-splice` is not allowed here" in e.value.msg
587+
588+
def test_top_level_unquote():
589+
placeholder_macro("unquote")
590+
placeholder_macro("unquote-splice")
591+
placeholder_macro("unquote_splice", "unquote-splice")
592+
593+
594+
def test_bad_exception():
595+
placeholder_macro("except")
596+
placeholder_macro("except*")
597+
placeholder_macro(hy.mangle("except*"), "except*")
590598

591599

592600
def test_lots_of_comment_lines():

0 commit comments

Comments
 (0)