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?
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to