import-java icon indicating copy to clipboard operation
import-java copied to clipboard

how can i import a inner class?

Open liuxia19872003 opened this issue 4 years ago • 1 comments

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?

liuxia19872003 avatar Jul 05 '20 06:07 liuxia19872003

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 :-)

Arnie97 avatar Jul 14 '20 17:07 Arnie97