Popular recipes tagged "inheritance" and "subclass"http://code.activestate.com/recipes/tags/inheritance+subclass/2011-04-20T21:50:23-07:00ActiveState Code RecipesAbstract method decorator (Python)
2011-04-20T21:50:23-07:00jimmy2timeshttp://code.activestate.com/recipes/users/4177690/http://code.activestate.com/recipes/577666-abstract-method-decorator/
<p style="color: grey">
Python
recipe 577666
by <a href="/recipes/users/4177690/">jimmy2times</a>
(<a href="/recipes/tags/abstract/">abstract</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/exception/">exception</a>, <a href="/recipes/tags/inheritance/">inheritance</a>, <a href="/recipes/tags/method/">method</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/subclass/">subclass</a>).
Revision 5.
</p>
<p>A simple decorator that helps define abstract methods: when such a method is called, an appropriate exception is raised.</p>
Find all subclasses of a given class (Python)
2009-11-04T20:26:08-08:00Gabriel Genellinahttp://code.activestate.com/recipes/users/924636/http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/
<p style="color: grey">
Python
recipe 576949
by <a href="/recipes/users/924636/">Gabriel Genellina</a>
(<a href="/recipes/tags/class/">class</a>, <a href="/recipes/tags/extending/">extending</a>, <a href="/recipes/tags/inheritance/">inheritance</a>, <a href="/recipes/tags/plugin/">plugin</a>, <a href="/recipes/tags/subclass/">subclass</a>, <a href="/recipes/tags/subclasses/">subclasses</a>, <a href="/recipes/tags/type/">type</a>).
Revision 3.
</p>
<p>itersubclasses(cls) returns a generator over all subclasses of cls, in depth first order. cls must be a new-style class; old-style classes are <em>not</em> supported.</p>