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

Greg Ward gward@mems-exchange.org
Mon, 3 Jul 2000 10:08:37 -0400


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!

        Greg
-- 
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange / CNRI                           voice: +1-703-262-5376
Reston, Virginia, USA                            fax: +1-703-262-5367