]> gitweb.factorcode.org Git - factor.git/commitdiff
python: fix tests
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 18 Jan 2022 21:47:25 +0000 (13:47 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 18 Jan 2022 21:47:25 +0000 (13:47 -0800)
extra/python/python-tests.factor
extra/python/syntax/syntax-tests.factor

index e7cb91a1fa391c0e592501bd2ab7c7db131425ad..94b4ce1b81520fb54ca68c71750c502f73868a1d 100644 (file)
@@ -181,11 +181,20 @@ IN: python
 : py-map ( -- alien )
     "builtins" py-import "map" getattr ;
 
+: py-list ( -- alien )
+    "builtins" py-import "list" getattr ;
+
+: py-list-call ( alien-cb -- seq )
+    [
+        py-list swap { 1 } >py 2array array>py-tuple f
+        call-object-full
+    ] with-callback py> ;
+
 : py-map-call ( alien-cb -- seq )
     [
         <py-cfunction> py-map swap { 1 2 } >py 2array array>py-tuple f
         call-object-full
-    ] with-callback py> ;
+    ] with-callback py-list-call py> ;
 
 : always-33-fun ( -- alien )
     [ 3drop 33 >py ] PyCallback ;
index 146c88ca6d7b716aabb3dfcfab4a31a703ffbc42..a1182cb585203a012734408696f0e3bf2a146e18 100644 (file)
@@ -157,6 +157,6 @@ PY-QUALIFIED-FROM: functools =>
 
 { 48 } [
     reduce-func [
-        { 1 2 8 1 2 34 } >py functools:reduce builtins.list py>
+        { 1 2 8 1 2 34 } >py functools:reduce builtins:list py>
     ] with-quot>py-cfunction
 ] py-test