graalpython icon indicating copy to clipboard operation
graalpython copied to clipboard

Exporting a method with a different name than its declaration

Open RevolvingMadness opened this issue 7 months ago • 2 comments

Let's say I have a Java class:

class Foo {
    public void bar() {
        System.out.println("bar");
    }
}

I want to access that bar method in python but with a different name. I swear a while ago I could do:

@HostAccess.Export(name = "barMethod")
public void bar() {
    System.out.println("bar");
}

But now the name field doesn't exist?

So then in Python it would be called with barMethod instead of bar.

RevolvingMadness avatar Jul 10 '24 17:07 RevolvingMadness