Skip to main content

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)

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_mutable-1.0.6-py2-none-any.whl (3.1 kB view details)

Uploaded Python 2

File details

Details for the file flake8-mutable-1.0.6.tar.gz.

File metadata

File hashes

Hashes for flake8-mutable-1.0.6.tar.gz
Algorithm Hash digest
SHA256 db04ab8603d4d28d1ec76ac7e7e135faa9688445209b5beee68a199db94442f4
MD5 aa3ce2dbc4bf8e28e8672d58388ac6b9
BLAKE2b-256 f0685b0d3e6257313224907c33eb965afca6ba8dfa5ab7c642cc80e570e0a119

See more details on using hashes here.

File details

Details for the file flake8_mutable-1.0.6-py2-none-any.whl.

File metadata

File hashes

Hashes for flake8_mutable-1.0.6-py2-none-any.whl
Algorithm Hash digest
SHA256 426697af2b8d902312fd79161760a491af7d6bce8621fdd2ad0e7a3146dae538
MD5 2017b30340e9c3c901364e5ed3c0a293
BLAKE2b-256 31b4b60bb641dfeb3d89eacfce06d427c2d8305d42814e65e70cf9cb5b382c3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page