A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-December/130733.html below:

[Python-Dev] One-line abstractmethod function?

[Python-Dev] One-line abstractmethod function? [Python-Dev] One-line abstractmethod function?Allen Li cyberdupo56 at gmail.com
Mon Dec 9 20:52:53 CET 2013
I just wanted to sum up this thread of discussion.

Proposal:
A function in abc to provide a default abstract method
implementation.

foo = make_abstractmethod('foo', ['self'])

is the same as

@abc.abstractmethod
def foo(self):
    pass

Details:
Default behavior, if implemented, should probably be empty/pass/return
None.  How to handle docstrings?  Either attribute docstring (a separate
discussion) or a parameter in the function call.

Pros:
Save a lot of lines defining interface-like ABCs, especially in small
scripts without docstrings (bad practice, but I do it often =))

Cons:
Do we need it?
More information about the Python-Dev mailing list

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