Python: Why would float.__new__(cls) work when cls isn't float?
<p>I'm a little confused by the following example from the python documentation <a href="http://www.python.org/download/releases/2.2/descrintro/#__new__" rel="nofollow">here</a>.</p>

<pre><code>&gt;&gt;&gt; class inch(float):
...     "Convert from inch to meter"
...     def __new__(cls, arg=0.0):
...         return float.__new__(cls, arg*0.0254)
...
&gt;&gt;&gt; print inch(12)
0.3048
&gt;&gt;&gt; 
</code></pre>

<p>Presumably, float is here is the actual float class defined somewhere deep inside Python. When we call <code>float.__new__(cls, argument)</code> , we're sneakily calling the function that returns instances of float for a given argument, but we're passing it the inch class instead of the float class. Since the inch class doesn't really do anything, why does this work? </p>
