[Zope3-Users] Eclipse + PyDev + deferred imports

Martin Aspeli optilude+lists at gmail.com
Tue Aug 11 20:48:29 EDT 2009

Shailesh Kumar wrote:
> I generally make it /from zope.component._api import getUtility/ to make 
> PyDev happy. It doesn't hurt the code and I don't have to see the 
> 'unresolved import message'.

You shouldn't do this. You shouldn't import from a module starting with 
an underscore. It's the developers' way of telling you to treat it as 
internal. 'from zope.component import getUtility' is almost certain to 
work "forever". The _api module could disappear in a refactoring tomorrow.

The only way to fix this is to make PyDev aware of zope.deferredimport. 
You could ask. :)


Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

More information about the Zope3-users mailing list