Skip to main content

flake8 super call checker

Project description

flake8-super-call is a Flake8 extension that checks Python methods for anti-pattern super calls.

When calling super in a derived class, passing self.__class__ to super() can give the wrong starting point to search for methods, and will end up calling its own method again. More details on this Stack Overflow question.

Installation

Install from PyPI using pip:

$ pip install flake8-super-call

The extension will be activated automatically by flake8. You can verify that it has been loaded by inspecting the flake8 --version:

$ flake8 --version
3.5.0 (flake8_super_call: 1.0.0, mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 2.7.10 on Darwin

Error Codes

This extension adds one new error code:

  • S777: Cannot use self.__class__ as first argument of super() call

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-super-call-1.0.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

flake8_super_call-1.0.0-py2.py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page