[Python-Dev] One-line abstractmethod function?
Ethan Furman
ethan at stoneleaf.us
Thu Dec 5 20:22:36 CET 2013
More information about the Python-Dev mailing list
Thu Dec 5 20:22:36 CET 2013
- Previous message: [Python-Dev] One-line abstractmethod function?
- Next message: [Python-Dev] One-line abstractmethod function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/05/2013 10:56 AM, Alexander Belopolsky wrote: > On Thu, Dec 5, 2013 at 1:24 PM, Guido van Rossum wrote: >> >> How would you get the docstrings in? [...] > > One way to reduce the amount of boilerplate code is to make abstractmethod > to supply raise NotImplementedError body when none is given. Then you can > write > > class Foo: > @abc.abstractmethod > def do_bar(self): > """perform bar""" > > The docstring will be required when skipping the body which is probably a good thing. How will abstractmethod know its function has no body? -- ~Ethan~
- Previous message: [Python-Dev] One-line abstractmethod function?
- Next message: [Python-Dev] One-line abstractmethod function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list