Note that there are some explanatory texts on larger screens.

plurals
  1. POBest way to import python module at the root of a package hierarchy from another module in the same package
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COShort of writing a very introspective hack like `import x` which changes `sys.path`, or overriding the semantics of `builtin.__import__` or creating import hooks as suggested in http://docs.python.org/library/functions.html#__import__ , you are looking for a very reasonable feature that does not exist in most languages I know of as of 2012. In my humble opinion, python is better suited than some other languages, but still particularly ill-suited for non-verbose imports. The "pythonic" view that such verbosity is explicit, and therefore good, will probably not make the feature forthcoming.
      singulars
    2. COI knew I would get what is the big deal about this, you are doing major refactoring anyways. Writing code is major refactoring all the time. You work with several packages, you put something in one place, then you realize it is major functionality that could be used elsewhere, so you refactor it in another package. There are som many things you need to worry when you move things around I am trying to minimize the overhead. By the way, I have an m0 at the top of every package, so when a module moves to another package and still refers to the m0 at the top of the first package, is error prone.
      singulars
    3. COYes, I agree. Yet I am not sure why you are saying what you are saying. I was not asking "what is the big deal about this".
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload