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)
--------------
#### 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.
Source Distribution
flake8-mutable-1.0.6.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for flake8_mutable-1.0.6-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 426697af2b8d902312fd79161760a491af7d6bce8621fdd2ad0e7a3146dae538 |
|
MD5 | 2017b30340e9c3c901364e5ed3c0a293 |
|
BLAKE2b-256 | 31b4b60bb641dfeb3d89eacfce06d427c2d8305d42814e65e70cf9cb5b382c3c |