[Twisted-Python] teud and __all__

Glyph Lefkowitz glyph at twistedmatrix.com
Thu Oct 11 17:33:41 MDT 2001


On Thursday, October 11, 2001, at 06:28  PM, Itamar Shtull-Trauring 
wrote:

> Glyph Lefkowitz wrote:
>
>
>> Also, about the __all__ attribute... might I suggest that this is a 
>> poor choice of names, since this already means something to the 
>> interpreter?  __teud__ might be a better way to put it.  Certainly 
>> __init__.py's shouldn't have an __all__ in them that describes classes 
>> (or modules) to *document*.
>
>
> That's why I chose it. __all__ means "all stuff to import when you do 
> 'from module import *'". In other words, the module's public 
> interfaces, exactly the one ones you want to document.

Hmm, I guess I was wrong.  I thought that in a package's __init__.py, 
__all__ defined those modules which were imported automatically when the 
package was imported.  After disproving that theory I realize that 
there's probably no reason not to use __all__. :-)


--
______      you are in a maze of twisted little applications, all
|   |_\     remarkably consistent.
|     |          -- glyph lefkowitz, glyph @ twisted matrix . com
|_____|             http://www.twistedmatrix.com/





More information about the Twisted-Python mailing list