"Ben Wolfson" <wolfson at uchicago.edu> wrote in message news:yvHB6.142$E4.6764 at uchinews... > In article <mailman.987183619.7370.python-list at python.org>, "Carlos > Ribeiro" <cribeiro at mail.inet.com.br> wrote: > > > In Delphi, there is a "abstract" keyword that can be used as syntactic > > sugar as in the example below: > > > > class B: > > def __init__(self): abstract > > def dosomething(self): abstract > > > > ...where "abstract" will raise a "abstract method exception". Do anyone > > smells a PEP here <wink>? > > You can already do: > > class B: > def __init__(self): raise NotImplementedError > def dosomething(self): raise NotImplementedError > > or even: > > def _abstract(): raise NotImplementedError > class B: > def __init__(self): _abstract() Or even: def abstract(self, *args, **kwargs): raise NotImplementedError class B: __init__ = abstract dosomething = abstract -- Rainer Deyke (root at rainerdeyke.com) Shareware computer games - http://rainerdeyke.com "In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4