[TransWarp] TransWarp subpackage re-orgs

Phillip J. Eby pje at telecommunity.com
Sat Jan 19 18:59:31 EST 2002


Hi all.  I've just checked in a change to TransWarp to make a 'Utils' 
package which is a home for modules which can be used outside of TransWarp 
and which do not needed to be imported in order to use TransWarp 
API's.  Mostly, these are modules formed by splitting up the old 
'TW.Utilities' module.

I'm planning to create another major subpackage for what is now referred to 
as the TransWarp "kernel" - the API for generative, meta-, and 
aspect-oriented programming.  All the current kernel modules (or their 
equivalents) will move to that subpackage.  I'm trying to decide on a name 
and an import strategy, however.

The purpose of this is that I'm trying to emulate Zope 3's fine example of 
making packages separately importable, by having side-effect-free 
'__init__' modules.  Currently, you can't use anything from any 'TW' 
subpackage without causing the kernel to be imported, which makes the 
'TW.Utils' package somewhat less useful as a set of standalone utilities.

I see two alternatives for the import strategy:

1. Make the kernel a subpackage, from which you normally "import *".  This 
would replace the current "from TW import *" with "from TW.X import *" 
(where X is an as-yet undecided name).  This would require you to also 
"from TW import SEF" if you wanted to use the SEF module the way it's 
currently used.

2. Make the kernel a subpackage named "TW" or something similarly short, 
and keep "from TW import *", but now use the subpackage name as a 
prefix.  So, where you currently "from TW import *; build(someSpec)", you 
would now "from TW import *; TW.build(someSpec)", or "from TW.TW import *; 
build(someSpec)".

No matter what I do, this is going to be backward-incompatible, because 
right now you can get away with "from TW import *" and no prefixing of 
names.  The only possible way to get around this would be to make 
"TW.Utils" into "TWUtils" or some such, and make it a peer of "TW", which 
I'm rather disinclined to do, since it would break everyone's CVS 
checkouts, but also because it's ugly.

I'd like to get some feedback on this issue before I proceed with the 
re-org.  Especially, I'd like a good name for the thing I keep calling the 
"kernel".  I've thought of making it TW.Core (which could be confused with 
WarpCORE later), TW.Kernel, TW.Meta, TW.GP, and various others...  nothing 
seems to me to quite fit.  Please send your suggestions.  Thanks!





More information about the PEAK mailing list