-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
releasedIncluded in a releaseIncluded in a release
Description
Is your feature request related to a problem?
For some functions, we might want to offer a different interface than Python offers. For example, we might want to replace the Python code ', '.join([1, 2]) with [1, 2].join(', ').
Desired solution
An annotation @PythonCall that is evaluated by the code generator that specifies how code should be rewritten. The annotation takes a string that can have placeholder that point either to this or a parameter. Example:
class List {
@PythonCall("$delimiter.join($this)")
fun join(delimiter: String) -> String
}
The code generator can then replace the placeholders with the actual values of this and the parameters. For the call [1, 2].join(', '), it would then generate the Python code ', '.join([1, 2]).
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response
Metadata
Metadata
Assignees
Labels
releasedIncluded in a releaseIncluded in a release
Type
Projects
Status
✔️ Done