Use a with block to control export (public/private/__all__)

Yeah a namespace is an option, it is mentioned in the pole running currently. A disadvantage is that it doesn’t ‘play nice’ with __all__, something the with export block does. So for example, outside of the export block __all__ can be manually manipulated. People needing to manually managing __all__ is something that derailed PEP 482 (see postmortem).