jython type coercion to interface type
Harald Kirsch
pifpafpuf at gmx.de
Wed Jun 25 13:41:52 EDT 2003
More information about the Python-list mailing list
Wed Jun 25 13:41:52 EDT 2003
- Previous message (by thread): SSL in Python
- Next message (by thread): jython type coercion to interface type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
How would I call a java constructor which takes a java.lang.CharSequence
as argument. Say, the java class goes like this
class X {
public X(CharSequence s) { ... }
}
In the jython interpreter I tried along the lines of
x = X("bla")
and got "1st arg can't be coerced to java.lang.CharSequence". Then
x = X(CharSequence("bla"))
and got "can't instantiate interface (java.lang.CharSequence)"
Is there a way to typecast String to CharSequence or, mor generally,
a type to a supertype or interface?
Harald Kirsch
- Previous message (by thread): SSL in Python
- Next message (by thread): jython type coercion to interface type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list