[Zope-dev] Coding style clarifications

Jim Fulton jim at zope.com
Fri Feb 20 09:39:32 EST 2009


On Feb 20, 2009, at 7:48 AM, Joachim König wrote:
...
>> 2. Depending on what code you might unearth, Interface could be  
>> either  zope.interface.Interface, or the older version  
>> Interface.Interface.   Package qualification makes this unambiguous.
>>
> if module qualification is enough and "from" discouraged one could  
> as well write:
>
>  import zope.interface as interface
>
>  class IFoo(interface.Interface):
>
>   ...


"as" is evil and should never be used except in the most extreme  
circumstances, if there even are any that extreme.

We have recommended:

  from zope import interface, component

and then not having to type "zope.", as you suggest above.  I've come  
to dislike this because:

- It doesn't buy that much, and

- It's an odd case that has to be recognized.

Jim

--
Jim Fulton
Zope Corporation




More information about the Zope-Dev mailing list