[Python-ideas] ABC: what about the method arguments ? (original) (raw)

Daniel Stutzbach daniel at stutzbachenterprises.com
Thu Sep 23 16:54:55 CEST 2010


On Thu, Sep 23, 2010 at 9:37 AM, Tarek Ziadé <ziade.tarek at gmail.com> wrote:

The problem is that the implemented method could have a different list of arguments and will eventually fail.

A slightly different argument list is okay if it is more permissive. For example, the collections.Sequence ABC defines a count method with one parameter. However, the list implementation's count method takes one mandatory parameter plus two optional parameters. I'm not sure how easy it would be to detect a valid but more general signature.

You might be interested in the related Issue 9731 ("Add ABCMeta.has_methods and tests that use it").

-- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com/> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100923/ea38a9a7/attachment.html>



More information about the Python-ideas mailing list