[Zope3-dev] __init__.py interfaces.py guidelines?
Jim Fulton
jim at zope.com
Tue Nov 22 16:44:49 EST 2005
Dieter Maurer wrote:
> Jim Fulton wrote at 2005-11-21 09:43 -0500:
>
>>...
>>A Python convention is that a leading underscore indicates privateness.
>>
>>
>>>- what about import paths inside a same package: relative or absolute?
>>>
>>> from mypackage.interfaces import ISomeInterface
>>>or:
>>> from interfaces import ISomeInterface
>>
>>Absolute always. Until the Python import mechanism is fixed, *always*
>>use absolute imports.
>
>
> But, this will make refactoring (moving modules around in the package
> hierarchy) more difficult.
It only makes moving packages around harder. If your package hierarchy
is deep enough that this matters, then I suggest that your package hierarchy
is too deep.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list