[Zope-ZEO] BTree setup script, and import wackiness

Jim Fulton jim@digicool.com
Wed, 05 Jul 2000 11:20:19 -0400


Greg Ward wrote:
> 
> On 03 July 2000, Andrew Kuchling said:
> > Adding to the collection of setup.py scripts, one for the BTree
> > directory is appended.
> >
> > After installing the BTree modules, I noticed some wackiness with
> > importing it:
> [...]
> > I see dependencies on import order as a Bad Thing. I wonder if the
> > following line in BTree.c should be changed to use ZODB.cPersistence?
> >   if(cPersistenceCAPI=PyCObject_Import("cPersistence","CAPI"))
> 
> Agreed, but what's even worse is *how* ZODB's trickery works: as near as
> I can tell, importing certain modules magically creates new modules (by
> frobbing sys.modules? not sure) that are then importable -- and what is
> "imported" bears no relation to the file on disk that you would *think*
> was imported.
> 
> This is just plain evil, and as near as I can tell unnecessary.  Stamp
> out gratuitious complexity!

If you ever had to change 100s of modules to use ZODB.Persistent
rather than BoboPOS.Persistent and also worry about all of the
other modules that were written by 3rd parties, then you might
not consider this complexity to be gratuitous.

Jim

--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org    

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.