Jython import coventions

Discussion in 'Python' started by Benjamin, Oct 10, 2007.

  1. Benjamin

    Benjamin Guest

    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 *?
     
    Benjamin, Oct 10, 2007
    #1
    1. Advertising

  2. Benjamin

    Guest

    On Oct 9, 10:42 pm, Benjamin <> wrote:
    > 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.
     
    , Oct 10, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Dahlhausen

    jython import

    Kevin Dahlhausen, Feb 13, 2004, in forum: Python
    Replies:
    2
    Views:
    4,446
    Kevin Dahlhausen
    Feb 20, 2004
  2. David McNab
    Replies:
    0
    Views:
    509
    David McNab
    Apr 9, 2004
  3. Divya Prakash
    Replies:
    0
    Views:
    450
    Divya Prakash
    Dec 19, 2006
  4. vital

    Patterns and Naming Coventions

    vital, Dec 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    293
    Eliyahu Goldin
    Dec 2, 2007
  5. Pinegar, Kent T

    FW: [Jython-users] Jython Licensing Question

    Pinegar, Kent T, Jul 24, 2008, in forum: Python
    Replies:
    0
    Views:
    361
    Pinegar, Kent T
    Jul 24, 2008
Loading...

Share This Page