Jython import coventions

B

Benjamin

When importing Java packages in Jython, what is the convention to
simplify imports? For example:
import java.util as util
Is this correct? Or should I use from * import *?
 
O

OnCallSupport321

When importing Java packages in Jython, what is the convention to
simplify imports? For example:
import java.util as util
Is this correct? Or should I use from * import *?

I have preferred the style...

import java
import javax

....and then using complete references to java classes, in your case,
java.util.whatever. It clearly shows me where I'm using Python classes
vs. java classes when I read my own code. For this situation, more
path structure seems less confusing to me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,179
Latest member
pkhumanis73
Top