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.1.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for flake8_mutable-1.1.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efe040cd13fde5b8a940deda4c278cdb183cfe34cd32505a90aa506cd9715eed |
|
MD5 | 59ba4ccc52b57a73dd1d2ebefd340e62 |
|
BLAKE2b-256 | ab9eab8c60a99b14d3c30b013144993fcf69c97adfae99fb92fa7f8caace683a |