Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i import a inner class? #1

Open
liuxia19872003 opened this issue Jul 5, 2020 · 1 comment
Open

how can i import a inner class? #1

liuxia19872003 opened this issue Jul 5, 2020 · 1 comment

Comments

@liuxia19872003
Copy link

liuxia19872003 commented Jul 5, 2020

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?

@Arnie97
Copy link
Owner

Arnie97 commented Jul 14, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants