On 4/23/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > from overloading import overload, abstract > > def foo(bar, baz): > """Default implementation here""" > > > @overload > def foo(bar:int, baz:str): > """Overloaded implementation for int/str here""" > > > @abstract > def spam(fizz): > """This function has no default implementation, and raises > a "no applicable methods" error if called..."""
(a) What's the point of having a separate keyword for this, as opposed to just raising an exception from the body? (b) I'm proposing an @abstractmethod, which sets its argument's __isabstractmethod__ attribute and then returns it, otherwise unchanged. Would this be good enough for you, or do you need @abstract to do more? My point is, I could rename mine to @abstract so that it would serve your purpose as well -- but only if it would serve. > @overload > def spam(fizz:list): > """...unless an appropriate overload is added first""" > > Any questions? :) I'd like the examples even better if they used ABCs from PEP 3119. :-) -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
