Skip to main content
Help us improve Python packaging – donate today!

mutable defaults flake8 extension

Project Description

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

[![PyPI version](https://img.shields.io/pypi/v/flake8-mutable.svg)](https://pypi.python.org/pypi/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:14: M511 - mutable default arg of type Dict
```

#### Installation

```
pip install flake8-mutable
```

#### Changes

##### [1.1.0] 2016-11-26
- Callables

##### [1.0.6] 2016-11-26
- added MANIFEST.in

#### License

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

Release history Release notifications

This version
History Node

1.2.0

History Node

1.1.0

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

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.2.0-py2-none-any.whl (3.4 kB) Copy SHA256 hash SHA256 Wheel 2.7 Apr 24, 2017
flake8-mutable-1.2.0.tar.gz (3.0 kB) Copy SHA256 hash SHA256 Source None Apr 24, 2017

Supported by

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