Le 17 Mar 2005 12:27:07 -0800, [EMAIL PROTECTED] a écrit :
> dear readers,
>
> i have a very simple package organized as follows:
>
> !-----------------------------------------!
> bgp/
> __init__.py
> managers/
> __init__.py
> ManagerInterface.py
> TestManager.py
> !-----------------------------------------!
>
> and here's ManagerInterface.py and TestManager.py:
>
> !-----------------------------------------!
> # ManagerInterface.py
> class ManagerInterface(object):
> def __init__(self): pass
> def process(self, recset, operation):
> print 'In ManagerInterface.process()...'
>
> # TestManager.py
> import ManagerInterface
# ManagerInterface is a module not a class !
# try
from ManagerInterface import ManagerInterface
> class TestManager(ManagerInterface):
# you can also define __init__ method with a super call
> def process(self, recset, operation):
> print 'In TestManager.process()...'
> super(TestManager,self).process(recset,operation)
> !-------------------------------------------!
>
>
> thanks!
> aaron
>
--
http://mail.python.org/mailman/listinfo/python-list