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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8-mutable-1.0.6.tar.gz.
File metadata
- Download URL: flake8-mutable-1.0.6.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db04ab8603d4d28d1ec76ac7e7e135faa9688445209b5beee68a199db94442f4
|
|
| MD5 |
aa3ce2dbc4bf8e28e8672d58388ac6b9
|
|
| BLAKE2b-256 |
f0685b0d3e6257313224907c33eb965afca6ba8dfa5ab7c642cc80e570e0a119
|
File details
Details for the file flake8_mutable-1.0.6-py2-none-any.whl.
File metadata
- Download URL: flake8_mutable-1.0.6-py2-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
426697af2b8d902312fd79161760a491af7d6bce8621fdd2ad0e7a3146dae538
|
|
| MD5 |
2017b30340e9c3c901364e5ed3c0a293
|
|
| BLAKE2b-256 |
31b4b60bb641dfeb3d89eacfce06d427c2d8305d42814e65e70cf9cb5b382c3c
|