[Zope-dev] Re: deferredimport?

2007-11-25 Thread Philipp von Weitershausen

Chris Withers wrote:

Is deferredimport handy for dealing with circular import problems,


Sure.


or was it targetted at solving another problem?


From zope.deferredimport/trunk/src/zope/deferredimport/README.txt or 
its PyPI page (http://pypi.python.org/pypi/zope.deferredimport/3.4.0):


  Often, especially for package modules, you want to import names for
  convenience, but not actually perform the imports until necessary.
  The zope.deferredimport package provided facilities for defining names
  in modules that will be imported from somewhere else when used.  You
  can also cause deprecation warnings to be issued when a variable is
  used, but we'll get to that later.


(Btw, this thread has nothing to do with the development *of* Zope and 
is therefore [EMAIL PROTECTED] or [EMAIL PROTECTED] rather than 
zope-dev@zope.org material.)

___
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 )


[Zope-dev] Re: deferredimport?

2007-11-25 Thread Chris Withers

Philipp von Weitershausen wrote:

Chris Withers wrote:

Is deferredimport handy for dealing with circular import problems,


Sure.


Is this it's primary reason for existence?


  Often, especially for package modules, you want to import names for
  convenience, but not actually perform the imports until necessary.
  The zope.deferredimport package provided facilities for defining names
  in modules that will be imported from somewhere else when used.  You
  can also cause deprecation warnings to be issued when a variable is
  used, but we'll get to that later.


Well, this says what it does but not why it was written...

(Btw, this thread has nothing to do with the development *of* Zope and 


That's not strictly speaking true ;-)

I bumped into zope.deferredimport while reading the code in 
zope.component's __init__.py which uses zope.deferredimport quite 
heavilly... however, the comment for r67110 suggests the creation of 
zope.component._api was due to circular import problems.


If zope.deferredimport solves these problems, why was ._api needed?

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
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 )