RE: [Types-sig] Re: PRE-PROPOSAL: Python Interfaces
by Barry A. Warsaw other posts by this author
Nov 24 1998 10:24PM messages near this date
Re: [Types-sig] Re: PRE-PROPOSAL: Python Interfaces
|
Re: [Types-sig] Re: PRE-PROPOSAL: Python Interfaces
> >>>> "TP" == Tim Peters <tim_one@[...].com> writes:
TP> As we discussed on the egroups version of this, if interfaces
TP> allow supplying impementation, then
| from InterfaceSupport import deferred
| class Stack(Interface):
| def push(self, thing): deferred()
| etc
TP> would make everyone who *claims* to implement Stack pick up
TP> the (presumably error-raising) Stack.push "deferred()"
TP> implementation if they don't supply their own (or inherit some
TP> other) real implementation of push.
That definitely does the trick, assuming we add something like a
NotImplementedError to the core and perhaps even a builtin function
deferred() that just raises the exception. Half of me wants something
a little more magical (and thus less dependent on the author to play
the right game)... okay make that 1/4 of me.. no 1/8... urg.
-Barry
Thread:
Barry A. Warsaw
Barry A. Warsaw
Jim Fulton
Barry A. Warsaw
Tim Peters
Tim Peters
|