skip to navigation
skip to content

flake8-mutable 1.2.0

mutable defaults flake8 extension

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)
 
File Type Py Version Uploaded on Size
flake8-mutable-1.2.0.tar.gz (md5) Source 2017-04-24 2KB
flake8_mutable-1.2.0-py2-none-any.whl (md5) Python Wheel 2.7 2017-04-24 3KB