Is there any way to get the global namespace of the module in which a class was defined? Answers for both Python 2.x and 3.x will be cheerfully accepted.