Hi Stefan

On 2012-W44-5, at 19:23, Stefan H. Holek wrote:

> That said, there are ways to avoid import cycles. One is to very carefully 
> craft your modules so they do not have to import from each other. Another is 
> to not have imports at the module level, but move them into the functions 
> where they are required.

I've also thought about that. I do not like the fact that I then need to 
educate the other developers about minute details of the import machinery just 
so they can add code to the library. I'm currently the only developer doing 
actual work in Python and would like to make the transition as painless as 
possible.

> Third, large libraries like the Zope Toolkit usually have mechanisms to defer 
> imports to some point after initial loading. You may want explore this 
> direction as well. [2]

Hmm, I like the idea but sadly it doesn't look very IDE-friendly.

Thanks for your tips!
Michael

[1]: http://docs.zope.org/zopetoolkit/codingstyle/python-style.html

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to