title: Python class return types
body: <p>I was wondering if anyone could help me with something.
  If I have a class that has an attribute is there a way to automatically make an object of that class return that attribute whenever it is called</p>
  
  <pre><code>class Constant():
  def __init__(self, value):
      self.__value = value
  PI = Constant(3.14)
  </code></pre>
  
  <p>Is there any way for it to return 3.14 (as an actual float not a string) without explicitly defining the <code>__float__</code> method and calling <code>float(PI)</code>.  I want to be able to just say something along the lines of <code>print(PI*2)</code> and to get <code>6.28</code> as my output</p>
  
  <p>EDIT:
  I found what I wanted, by using the <code>__new__</code> method i can change the return value from an instance to whatever I want.</p>
  
  <p>2nd EDIT:
  turns out that didn't work.</p>