import-java
import-java copied to clipboard
how can i import a inner class?
the inner class in the jar is named like XXX$XXXX.class,eg,"IndexWriterConfig$OpenMode.class"(in lucene).how can i import OpenMode in python?
Hi Liu Xia,
This module was meant to be a showcase for the potential capabilities of Python import hooks. All the underlying heavy-lifting work is actually done by PyJnius (or JavaBridge), so you could just call it directly without my black magics:
>>> from jnius import autoclass
>>> autoclass('android.provider.Settings$Secure')
<class 'jnius.reflect.android.provider.Settings$Secure'>
Anyway I'll leave this issue open. If anybody is interested in hacking around the AST and enable $ support in the Python interpreter, please feel free to file a pull request :-)