Most recently I wrote a hack, temporarily named "pyexport", which allows you to control the names which your library module namespaces export to application code.
So far, I've implemented a few features.
export.alias(), which registers an alias for a method in another module that will not be imported until that module is imported,export.explicitly(), a convenience function which makes cooperating with__all__easyexport.internal(), which marks a module as "internal", and warns any application code (code outside the package which defines the module) which tries to import itexport.restrict(), a method which prevents "leakage" of extraneous imported or private names - for example, if you have a module 'foo' which imports 'sys', you can normally do 'from foo import sys' in Python and get a result.export.singleton(), which replaces the calling module with a proxy that shares a namespace between the given singleton and the module itself.



