Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Osmo Maatta
Hello, Sub class test fails. == I have a program that needs to load plugin-classes during runtime. The program has these subdirectories (modules). $ tree . `-- test.py | |-- plugins | |-- base_plugin.py | |-- base_plugin.pyc | |-- __init__.py | `-- oca |

Re: Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Arnaud Delobelle
Osmo Maatta osm...@gmail.com writes: Hello, Sub class test fails. == I have a program that needs to load plugin-classes during runtime. The program has these subdirectories (modules). $ tree . `-- test.py | |-- plugins | |-- base_plugin.py | |--

Re: Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Peter Otten
Osmo Maatta wrote: Hello, Sub class test fails. == I have a program that needs to load plugin-classes during runtime. The program has these subdirectories (modules). $ tree . `-- test.py | |-- plugins | |-- base_plugin.py | |-- base_plugin.pyc | |--

Re: Finding and loading subclasses dynamically. issubclass(x, base_plugin.Plugin) fails.

2010-08-29 Thread Osmo Maatta
Re-hi and thank you. That solved my problem. I can now see that the base_plugin.Plugin is loaded several times. The numeric id(the_class) is not the same in all places. Anyway, I thought that a class is always the same if it has been loaded from the same module (in Linux/Unix; from the same file