On 12/05/2013 10:20 AM, Allen Li wrote: > > 90% of the time, it ends up looking something like this: > > class Foo(metaclass=abc.ABCMeta): > > @abc.abstractmethod > def f1(self): > raise NotImplementedError > > @staticmethod > @abc.abstractmethod > def f2(arg1): > raise NotImplementedError I think we're getting sidetracked by the `raise NotImplementedError` -- why do you have that line in there? If I understand the ABCs correctly a class that does *not* have concrete methods to replace the abstract methods will raise an exception at class creation time, so why do you need the `raise NotImplementedError`? It would only ever happen on a super() type of call. Having said all that, I would hope that any abstract class I had to implement would have good doc strings, and the multi-line format is much easier to read. -1 on the one-liner. -- ~Ethan~
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