Skip to content

Commit

Permalink
Merge pull request #2353 from Kodiologist/release
Browse files Browse the repository at this point in the history
Release Hy 0.25.0
  • Loading branch information
Kodiologist committed Nov 8, 2022
2 parents b107100 + 4404c11 commit 04866e5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
19 changes: 10 additions & 9 deletions NEWS.rst
@@ -1,26 +1,27 @@
.. default-role:: code

Unreleased
0.25.0 (released 2022-11-08)
==============================

Other Breaking Changes
Breaking Changes
------------------------------
* `dfor` no longer requires brackets around its final arguments, so
`(dfor x (range 5) [x (* 2 x)])` is now `(dfor x (range 5) x (* 2
x))`.

New Features
------------------------------
* Python 3.11 is now supported.
* `except*` (PEP 654) is now recognized in `try`.
* `except*` (PEP 654) is now recognized in `try`, and a placeholder
macro for `except*` has been added.

Bug Fixes
------------------------------
* Fixed `hy.repr` of `slice` objects with non-integer arguments.
* `__file__` should now be set the same way as in Python.
* `\N{…}` escape sequences are now recognized in f-strings.
* Fixed a bug with `python -O` where assertions were still partly
evaluated.
* `\N{…}` escape sequences are now recognized in f-strings.
* Fixed `hy.repr` of `slice` objects with non-integer arguments.

New Features
------------------------------
* Python 3.11 is now supported.

Misc. Improvements
------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/api.rst
Expand Up @@ -1428,6 +1428,7 @@ expanded, is crash, regardless of their arguments:

- ``else``
- ``except``
- ``except*``
- ``finally``
- ``unpack-mapping``
- ``unquote``
Expand Down
3 changes: 2 additions & 1 deletion hy/core/result_macros.py
Expand Up @@ -1895,7 +1895,8 @@ def compile_let(compiler, expr, root, bindings, body):


@pattern_macro(
"unquote unquote-splice unpack-mapping except finally else".split(), [many(FORM)]
"unquote unquote-splice unpack-mapping except except* finally else".split(),
[many(FORM)],
)
def compile_placeholder(compiler, expr, root, body):
raise ValueError(f"`{root}` is not allowed here")
20 changes: 14 additions & 6 deletions tests/compilers/test_ast.py
Expand Up @@ -579,14 +579,22 @@ def test_setv_builtins():
)


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

with pytest.raises(HyLanguageError) as e:
can_compile("(unquote-splice)")
assert "`unquote-splice` is not allowed here" in e.value.msg

def test_top_level_unquote():
placeholder_macro("unquote")
placeholder_macro("unquote-splice")
placeholder_macro("unquote_splice", "unquote-splice")


def test_bad_exception():
placeholder_macro("except")
placeholder_macro("except*")
placeholder_macro(hy.mangle("except*"), "except*")


def test_lots_of_comment_lines():
Expand Down

0 comments on commit 04866e5

Please sign in to comment.