How to inherit Base class with singleton in python
<p>I have base class which is singleton, i need to inherit that in my another class but i get error message as 
TypeError: Error when calling the metaclass bases
    function() argument 1 must be code, not str</p>

<p>Can someone help with this.
Below is sample code.</p>

<pre><code>def singleton(cls):
  instances = {}
  def getinstance():
    if cls not in instances:
      instances[cls] = cls()
    return instances[cls]
  return getinstance

@singleton
class ClassOne(object):

  def methodOne(self):
    print "Method One"

  def methodTwo(self):
    print "Method Two"


class ClassTwo(ClassOne):
  pass
</code></pre>