Skip to main content

mutable defaults flake8 extension

Project description

flake8-mutable
--------------

#### Motivation

Python's default arguments are evaluated at definition as opposed to when the function is invoked. This leads to unexpected behavior, as mutations persist between calls. For a more detailed explanation, see [The Hitchhiker's Guide to Python](http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments).

#### Example

```
def fnc(a, b={}):
pass

foo.py:2:1: M511 - mutable default arg of type Dict
```

#### Installation

```
pip install flake8-mutable
```


#### License

[MIT](https://opensource.org/licenses/MIT)

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
flake8_mutable-1.1.0-py2-none-any.whl (3.1 kB) Copy SHA256 hash SHA256 Wheel py2 Nov 26, 2016
flake8-mutable-1.1.0.tar.gz (2.5 kB) Copy SHA256 hash SHA256 Source None Nov 26, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page