-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Overriding constructors for classes inheriting from Java #367
Comments
Yes, it's a known limitation, because we need to have already created the Java object by the time we call import java
class ParseException(java.lang.Exception):
pass
print(ParseException("my message").getMessage()) |
I see, thanks for the explanation. Is this a hard limitation, or will this be addressed in the a future release? |
Calling the constructor from class MyException(java.lang.Exception):
def __new__(cls):
return cls.__constructor__("my message") This currently doesn't work, I made up the |
Will this then be addressed in some upcoming release? We can keep this issue open if required for tracking purposes, and not close it even if #368 is merged |
Let's keep it open, I want to do the |
As of the latest version (23.1.0), GraalPy does not support overriding constructors for Python classes that inherit from Java.
The example below throws an error when we try to create a custom
Exception
wrapper in Python:Result
The text was updated successfully, but these errors were encountered: