cf. this relatively recent conversation on the same topic-- worth reading in entirety:

https://mail.python.org/archives/list/python-ideas@python.org/thread/TAVHEKDZVYKJUGZKWSVZVAOGBPLZVKQG/

As I said in that conversation, in the past I have wanted to have module-like namespaces inside of modules because sometimes it makes organizational sense to not create a separate, very short, module file.  

Summary of how that thread turned out:

There seemed to be agreement among most of the conversation participants that this would be a useful idea, and a few different syntax ideas were batted about (a decorator, totally new syntax). A few people have experimented with various ways of doing this using current python but all of the ideas anyone has come up with so far would require some kind of change to the core language to make them work. The conversation didn't go any further than that (to my knowledge).


---
Ricky.

"I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler