In python, what is contained in the info property of a module object?
<p>I'm looking into creating a Plugin structure for a program and making it so even the core library is treated as plugins. in my research I came across this code that is dynamically importing modules.</p>

<pre><code>def __initialize_def(self, module):
    """Attempt to load the definition"""

    # Import works the same for py files and package modules so strip!
    if module.endswith(".py"):
        name = module [:-3]
    else:
        name = module

    # Do the actual import
    __import__(name)
    definition = sys.modules[name]

    # Add the definition only if the class is available
    if hasattr(definition, definition.info["class"]):
        self.definitions[definition.info["name"]] = definition
        logging.info("Loaded %s" % name)
</code></pre>

<p>I have tried to understand what this code is doing and I've succeeded to a point. However, I simply can't understand the latter part of the code, specifically these two lines:</p>

<pre><code>if hasattr(definition, definition.info["class"]):
    self.definitions[definition.info["name"]] = definition
</code></pre>

<p>I can't figure out what <code>definition.info["&lt;key&gt;"]</code> is referring to.</p>

<p>What is this <code>.info[]</code> dictionary and what does it hold? Is it common to all Python objects or only module objects? What is it useful for?</p>
