[Chicago] import question

skip at pobox.com skip at pobox.com
Tue Jan 22 23:05:32 CET 2008


    Massimo> Two natural solutions are:
    Massimo> 1) edit __init__.py and replace test.other with write  
    Massimo> contrib.test.other. This is not acceptable for me since I do not want  
    Massimo> to maintain the test module.

    Massimo> 2) add contrib to the path. This is also not acceptable because  
    Massimo> creates countless problems with py2exe and py2app. I have many  
    Massimo> modules and files with similar issues.

    Massimo> Does anybody know of a third solution?

2.6 (maybe 2.5 as well?) has some relative import notation using dots,
similar to, but not identical to unix parent directory notation.  I think
you want something like

    from .test.other import something

Skip


More information about the Chicago mailing list