title: Does Python support something like literal objects?
body: <p>In Scala I could define an abstract class and implement it with an object:</p>
  
  <pre><code>abstrac class Base {
      def doSomething(x: Int): Int
  }
  
  object MySingletonAndLiteralObject extends Base {
      override def doSomething(x: Int) = x*x
  }
  </code></pre>
  
  <p>My concrete example in Python:</p>
  
  <pre><code>class Book(Resource):
  
      path = "/book/{id}"
  
      def get(request):
          return aBook
  </code></pre>
  
  <p>Inheritance wouldn't make sense here, since no two classes could have the same <code>path</code>. And only one instance is needed, so that the class doesn't act as a blueprint for objects. With other words: no class is needed here for a <code>Resource</code> (<code>Book</code> in my example), but a base class is needed to provide common functionality.</p>
  
  <p>I'd like to have:</p>
  
  <pre><code>object Book(Resource):
  
      path = "/book/{id}"
  
      def get(request):
          return aBook
  </code></pre>
  
  <p>What would be the Python 3 way to do it?</p>