[code-quality] pylint: __implements__ or abc.ABCMeta?

Dan Stromberg strombrg at gmail.com
Tue Aug 1 01:17:39 EDT 2017


I put a little time into exploring __implements__ and abc.ABCMeta today.,
in combination with pylint.

I guess it's about time I started using one or both of them.

I'm a little puzzled though.  It _seems_ like pylint is ignoring
__implements__, while abc.ABCMeta appears to be working the way I'd expect
it would.

I've put some sample code at
http://stromberg.dnsalias.org/svn/pylint-interface-experiment/trunk/  At
that URL, pie is an __implements__ experiment, and pabce is an ABC
experiment.

I found a year-old thread on stackoverflow saying that pylint no longer
does __implements__, which seems to fit with what I'm seeing.  However, the
pylint doc and pylint code (internally) still appear to use __implements__
- so maybe I'm just doing it wrong.  The thread:
https://stackoverflow.com/questions/20879269/why-pylint-keeps-saying-my-class-is-r0923-interface-not-implemented

Assuming they both still work (__implements__ and abc.ABCMeta), which is
preferred? Or are they a toss-up?

Any suggestions on how to get __implements__ working?

Thanks!

PS: I'm using:
pylint 1.7.1,
astroid 1.5.2
Python 3.4.2 (default, Apr 17 2017, 09:05:12)

-- 
Dan Stromberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/code-quality/attachments/20170731/28cff0a6/attachment.html>


More information about the code-quality mailing list