We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
return
1 parent 9c99e7d commit 129abe3Copy full SHA for 129abe3
py2hy/translate.hy
@@ -51,7 +51,7 @@
51
~@(T x.body))
52
53
Return
54
- `(return ~(T x.value))
+ `(return ~@(when x.value [(T x.value)]))
55
Delete
56
`(del ~@(T x.targets))
57
Assign
tests/test_misc.hy
@@ -41,6 +41,13 @@
41
(check "x[::-2]" '(cut x None None -2)))
42
43
44
+(defn test-return []
45
+ ; https://github.com/hylang/py2hy/issues/3
46
+ (assert (= (2hy "return 1") '(return 1)))
47
+ (assert (= (2hy "return None") '(return None)))
48
+ (assert (= (2hy "return") '(return))))
49
+
50
(defn test-chained-assignment []
; https://github.com/hylang/py2hy/issues/2
0 commit comments