Martijn Faassen wrote:
>    Since ``setuptools`` is a dependency of our packages anyway, we
>    can instead do the following::
> 
>        __import__('pkg_resources').declare_namespace(__name__)
> 
>    Feel free to use that and also feel free to simplify existing
>    ``__init__.py`` modules. Just make sure ``setuptools`` is a declared
>    dependency of the package.

Nit: In this case, two lines are better than one.

   import pkg_resources
   pkg_resources.declare_namespace(__name__)

There's no need to use the lesser known __import__ function when an 
ordinary import statement will do.

Shane

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to