flake8 plugin which checks for code that can be simpified
Project description
flake8-simplify
A flake8 plugin that helps you simplify your code.
Installation
Install with pip
:
pip install flake8-simplify
Python 3.6 to 3.8 are supported.
Usage
Just call flake8 .
in your package or flake your.py
:
$ flake8 .
./foo/__init__.py:690:12: SIM101 Multiple isinstance-calls which can be merged into a single call for variable 'other'
Rules
SIM101
: Multiple isinstance-calls which can be merged into a single call by using a tuple as a second argument.
Examples
SIM101
# Bad
isinstance(a, int) or isinstance(a, float)
# Good
isinstance(a, (int, float))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flake8_simplify-0.1.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for flake8_simplify-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb91e363aab4bba2f413ae1347676cb5f8d6f17f56579b99619a82cb4dbf80e1 |
|
MD5 | cb15a82ac8b866f117f2066a4abffc3f |
|
BLAKE2b-256 | 414f7049a8d7d6dc06bcb9c4912e37a48f290d12832311ecccedf147d7410967 |