Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support passing Python objects to Python methods from Perl 6
  • Loading branch information
niner committed Oct 14, 2014
1 parent 3f06038 commit d708019
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/Inline/Python.pm6
Expand Up @@ -216,6 +216,10 @@ multi method p6_to_py(Hash:D $value) returns OpaquePointer {
return $dict;
}

multi method p6_to_py(PythonObject:D $value) {
$value.ptr;
}

multi method p6_to_py(Any:U $value) returns OpaquePointer {
py_none();
}
Expand Down
4 changes: 1 addition & 3 deletions t/call.t
Expand Up @@ -3,7 +3,7 @@
use v6;
use Inline::Python;

say "1..11";
say "1..12";

my $py = Inline::Python.new();
$py.run('
Expand Down Expand Up @@ -138,13 +138,11 @@ else {
say "not ok 11 - Passing hashes to Python";
}

if False {
if ($py.call('__main__', 'test_foo', $py.call('__main__', 'Foo', 6)) == 6) {
say "ok 12 - Passing Python objects back from Perl 6";
}
else {
say "not ok 12 - Passing Python objects back from Perl 6";
}
}

# vim: ft=perl6

0 comments on commit d708019

Please sign in to comment.