title: Can modules have properties?
body: <p>Is it possible to add properties and special methods to modules?  I want to define a module such that importing it acts like a class instance, and the body acts as a class definition.  Essentially, it's to avoid ugly syntax like this:</p>
  
  <pre><code>import game
  if game.Game().paused:
      print("The game is paused")
  </code></pre>
  
  <p>E.g. the game module would look like this:</p>
  
  <pre><code>_Speed = 1
  
  @property
  def paused():
      return _Speed == 0
  </code></pre>
  
  <p>And the file using it:</p>
  
  <pre><code>import game
  if game.paused:
      print("The game is paused")
  </code></pre>
  
  <p>Also, is it possible to define special methods (such as <code>__call__</code>)?</p>
  
  <p>To be clear, I do not differentiate between class/instance methods, since I'm using <code>game.Game</code> as a singleton/<a href="http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-bo/" rel="noreferrer">borg</a> class.</p>
  
  <p>I have tested using @property and defining <code>__bool__</code>, but neither acts as I hoped.</p>
  
  <p>Edit (information on why I want to use a property):</p>
  
  <p>I have a property <code>game.speed</code>, a function <code>game.paused()</code> and a function <code>game.pause(bool)</code>.  Essentially, I have a temporary variable used to store the game speed when the game is paused.  There is a private speed variable that is set to zero when the game is paused.  I never want the user to see the speed as being zero, and be able to modify the speed while the game is paused, so that when the game is resumed, it uses the new speed.</p>