Is there a standard function to iterate over base classes in python?
<p>I would like to be able to iterate over all the base classes, both direct and indirect, of a given class, including the class itself.  This is useful in the case where you have a metaclass that examines an internal Options class of all its bases.</p>

<p>To do this, I wrote the following:</p>

<pre><code>def bases(cls):
    yield cls
    for direct_base in cls.__bases__:
        for base in bases(direct_base):
            yield base
</code></pre>

<p>Is there a standard function to do this for me?</p>
