[vmchecker-dev] relative imports

Alexandru Moșoi brtzsnr at gmail.com
Fri Mar 19 02:53:01 EET 2010


2010/3/19 Lucian Adrian Grijincu <lucian.grijincu at gmail.com>:
> I haven't been able to figure out whether relative imports are the way
> the imports should be done inside a library, or some workarround/hack
> I didn't understand.

as far as I know inside the library you do use only relative imports.


> The most unpleasant thing about relative imports is the impossibility
> or running that module as a script (the import fails), so we can't use
>  «if __name__ == "__main__"» to write simple tests :(

that's because you don't need  __main__ in a library. you should put
the tests in a different directory so that eventually we can automate
them.


-- 
Alexandru Moșoi
http://www.alexandru.mosoi.ro/


More information about the vmchecker-dev mailing list