Manage class instancing on a global scope in python
<p>I wish to control the time of instancing of a class MyClass, it needs to be unique and be able to reference it globally</p>

<pre><code># myclass.py
class MyClass():
    def __init__(self):
        pass

    def hello(self):
        return 'world'

class MyManager():
    def __init__(self):
        self.instance = None

    def create(self):
        self.instance = MyClass

manager = MyManager
</code></pre>

<p>The reason for this is because the class im working with have some dependencies at initialization which do not exist at the time of module import. (For the sake of the example above, I've left out the dependency)</p>

<pre><code># main.py
import myclass

myclass.manager.create

instance = myclass.manager.instance

hello = instance.hello
</code></pre>

<p>Now this is giving an error:</p>

<pre><code>AttributeError: class MyManager has no attribute 'instance'
</code></pre>

<p>Im relatively new to python, and have mostly been using it for linear scripts. What am i missing?</p>
