On Jan 2, 2014, at 3:37 AM, exar...@twistedmatrix.com wrote:

> Always refer to modules in the same way.  Never use relative imports.

Explicit relative imports preserve the benefit of being able to re-name your 
packages without editing every file inside them, but will still give you errors 
rather than silent pathological if you end up with an implicit Python path 
entry in the wrong place.

(Here is an termcast that illustrates the distinction: 
<http://asciinema.org/a/7016>.)

Also, any absolute import in python 2 can accidentally become implicitly 
relative given a sufficiently unfortunate set of circumstances.  Consider using 
'from __future__ import absolute_import' everywhere to make your imports less 
ambiguous.

-glyph

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to