Plugin system

exarkun at divmod.com exarkun at divmod.com
Sun Oct 31 20:36:40 CET 2004


On Sun, 31 Oct 2004 13:56:10 -0500, "Dan Perl" <danperl at rogers.com> wrote:
>
> [snip]
> 
> I forgot what I'm doing in my own code.  I looked at it again and found that 
> I'm not using isinstance(), instead I am doing a check for 
> "baseClass.Handler in hndlrCls.__bases__", which is much better, because it 
> doesn't need the creation of an instance.  Here is the actual code (my 
> handlers are the equivalent of your plugins):

  I wouldn't go as far as to say it is "much better".  Using issubclass() might be, though.

  Jp



More information about the Python-list mailing list