Well I want to implement plug-in like mechanism for an application . I want to define some minimum functions that any body writing a plugin has to implement. For that i thought an interface would be best because in a scenario where the function is not implemented some kind of error would occur. I would love to hear if you think their is a better way to achieve this
On Mon, Jun 29, 2009 at 2:49 PM, Alan Gauld <[email protected]>wrote: > "Amit Sethi" <[email protected]> wrote > >> class MyInterface(object): >> doSomething(line): >> raise NotImplementedError >> doSomethingElse(line): >> raise NotImplementedError >> >> I think that is exactly the kind of structure i was looking for ... >> > > As a matter of interest, why? What do you anticipate using this for? > I have found a few cases where abstract interfaces are useful but they are > very few and far between. > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > > _______________________________________________ > Tutor maillist - [email protected] > http://mail.python.org/mailman/listinfo/tutor > -- A-M-I-T S|S
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
