Runtime injection of attributes into module namespace
<p>When a python module I'm writing is imported, I want to create a set of attributes for the module based upon the contents of a dictionary defined in the same module. Here is a small portion of the dictionary from the module:</p>

<pre><code>list_of_constellations = {
   0: Constellation("And", "Andromeda"),
   1: Constellation("Ant", "Antlia"),
   2: Constellation("Aps", "Apus"),
   3: Constellation("Aql", "Aquila"),
}
</code></pre>

<p>where Constellation is a namedtuple. What I want is to inject a new set of attributes into the namespace whose name is the first element in the tuple and whose value is the key. So, after importing, the following attributes can be used:</p>

<pre><code>import constellations

print constellations.And   # prints 0
print constellations.Ant   # prints 1
</code></pre>

<p>How might I do this?</p>
