Exporting a method with a different name than its declaration

Open
#408 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, python
Domain
api, backend

Research direction

Start by examining the HostAccess.Export annotation and the Java-to-Python method export path described in the issue. Determine whether an exported method can receive an alias, then verify the behavior from Python; done means the Java bar method is callable as barMethod without changing its declaration.

Written by the indexing model from the issue text.

Description

good first issue

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.

Dominant language
Python
Stars
1.6k
Forks
155
Avg merge
9h 12m
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oracle/graalpython

All issues in oracle/graalpython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.