[Zope-CMF] Cleaning up imports, question about odd "feature"

Tres Seaver tseaver at palladion.com
Sat Dec 27 13:45:09 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

After spelunking through the maze of imports in the Zope2 core
indirected throught the Globals module, I resolved to rip out all such
imports (see a separate thread on zope-deve).  I also want to clean them
out of the CMF trunk, and so have been hunting through code which does
'from Globals import' and 'import Globals'.

I have found a couple of oddities:  both CMFCore.FSPropertiesObject and
CMFCore.FSSQLMethod use Globals.Development mode to decide whether or
not to give their class an '__of__' method.  I don't recall the
rationale, but it has been around *forever*, AFAICT.  I would like to
rip it out, and just make the '__of__' method there always, unless
somebody has a good argument for the current status.

I also plan to make all the currently relative imports absolute, since
relative imports break under later versions of Python, and I am making
some of them more precise:  e.g.:

  from AccessControl import ClassSecurityInfo

becomes:

  from AccessControl.SecurityInfo import ClassSecurityInfo

This is largely in aid of improving the dependency analysis of the parts
of the Zope2 core, but I think the practice is better, anyway.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJVne1+gerLs4ltQ4RAiTeAJoDTy4CkmD3nJu5UDx2EPPR2FQYNgCfYpqm
mJnaA/TX1ZTcOm8Qzq6JMYw=
=T1st
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list