[Zope3-dev] __init__.py interfaces.py guidelines?

Janko Hauser jhauser at zscout.de
Mon Nov 21 06:27:26 EST 2005


Am 21.11.2005 um 12:15 schrieb Martijn Faassen:

> My recommendations for any guidelines would be:
>
> * use namespace packages, so nothing (or very minimal stuff only,  
> like a few imports) in __init__.py. I think this is recommended  
> practice outside of Zope 3 as well, so we should stick with this.  
> Twisted seems to have small or empty __init__.py packages for  
> instance, and so does PEAK, to compare with some other large  
> frameworks in Python.
>
> * use interfaces.py and put interfaces there unless there's a very  
> good reason it should be private (which is rare).

I'm in support of all the suggestions Martijn has written. As a small  
addition I sometimes use a subdirectory interfaces with some modules,  
when I have many classes with different concerns in a namespace. But  
in the interfaces subdirectory I use __init__.py to import  
everything, so that for interface imports elsewhere it looks all the  
same.

with regards,

__Janko



More information about the Zope3-dev mailing list